develooper Front page | perl.perl5.porters | Postings from September 2011

Re: Regex warning

Thread Previous | Thread Next
From:
Brad Gilbert
Date:
September 23, 2011 10:15
Subject:
Re: Regex warning
Message ID:
CAD2L-T2fJGr=1_zH_DA93P4DgZx-kOBBzrowSCYLFJrE9d0T+Q@mail.gmail.com
On Wed, Sep 21, 2011 at 9:43 PM, Karl Williamson
<public@khwilliamson.com> wrote:
> On 09/21/2011 03:06 PM, Tom Christiansen wrote:
>>
>> David Nicol<davidnicol@gmail.com>  wrote
>>    on Wed, 21 Sep 2011 16:03:46 CDT:
>>
>>>>>>> $ bleadperl -we'$_="{";m/\b$_\b/'
>>>>>>> "\b{" is deprecated; use "\b\{" instead in regex; marked by<--
>>>>>>> HERE<SNIP>
>>
>>> I'm curious -- what is the deprecated meaning of "\b{" ? Was it
>>> introduced after 5.10? Is there a plan to, in the future, let \b take
>>> an optional curly-delimited argument?
>>
>> Yes, I believe that's the reason.  Unicode has word-, line-, and sentence-
>> break properties, and there's also the grapheme cluster string boundary.
>> Plus we do simplistic word boundaries based on \w, not the fancier version
>> that they recommend.
>>
>> --tom
>>
>
> I now regret not also deprecating '\w{'
>

Perhaps most cases of a bare '{' following a backslashed character
should be deprecated, where it hasn't already been annexed.

This would also increase the time from first deprecation until it is
actually used, for other cases.

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About