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

Re: Regex warning

Thread Previous | Thread Next
Brad Gilbert
September 23, 2011 10:15
Re: Regex warning
Message ID:
On Wed, Sep 21, 2011 at 9:43 PM, Karl Williamson
<> wrote:
> On 09/21/2011 03:06 PM, Tom Christiansen wrote:
>> David Nicol<>  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 Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About