Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Regarding the new \w regexp escape in 5.11

by demerphq (Chancellor)
on Oct 05, 2009 at 14:45 UTC ( #799258=note: print w/ replies, xml ) Need Help??


in reply to Regarding the new \w regexp escape in 5.11

I goofed. There are three codepaths for \s and \w and \d and i missed two(!!). Yes. I am embarrassed. Especially that it escaped into the wild without anyone noticing. It is a dev release tho.

Also just because your code is totally b0rked with no easy work around right now in 5.11.0 doesn't mean that 5.12 will have the same problem. The sky is officially NOT falling.

---
$world=~s/war/peace/g


Comment on Re: Regarding the new \w regexp escape in 5.11
Re^2: Regarding the new \w regexp escape in 5.11
by ajs (Initiate) on Oct 05, 2009 at 20:16 UTC

    If we're going to make this change (which appears to be compatible with other Unicode-handling modern regexen such as Python and PCRE), we should at least provide a way out for the user who wants true Unicode support without having to jump through lots of hoops. Python, for example, does this with (?u). Since Perl 5 uses (?letter) to map to the modifier letters, it seems obvious to make this a modifier :u, which should probably be turned on by default with "use locale".

    Doing that gives the expected behavior for POSIX-friendly uses and yet avoids snubbing users of P5 regexes who routinely match text from other languages/regions.

    na´vetÚ (n) - Assuming your experiences map cleanly to the set of all experiences....

      Im wondering if you somehow dropped a "not" in your first parenthetical remark.

      The fundamental problem here is that \w and behaves different if the string is utf8 or not. We want to make it so \w does the same thing regardless. That means that we end up breaking someones code. I really dont want to have to support three modes, one for the current broken behaviour, one for utf8 and one for ascii. I would much rather just support one mode, and have it be able to cover all the bases. Whether this is feasable or not going forward isnt clear.

      Feel free to provide more details on how these issues are tackled in other languages.

      ---
      $world=~s/war/peace/g

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://799258]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (10)
As of 2014-09-18 07:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (109 votes), past polls