Forum: Ruby-core [ruby-trunk - Bug #7972][Open] Regex Posix space class seems location-sensitive in Ruby 2.0.0-p0

Posted by jdashton (J Daniel Ashton) (Guest)
on 2013-02-26 21:25
(Received via mailing list)
Issue #7972 has been reported by jdashton (J Daniel Ashton).

----------------------------------------
Bug #7972: Regex Posix space class seems location-sensitive in Ruby 
2.0.0-p0
https://bugs.ruby-lang.org/issues/7972

Author: jdashton (J Daniel Ashton)
Status: Open
Priority: Normal
Assignee:
Category:
Target version:
ruby -v: ruby 2.0.0p0 (2013-02-24 revision 39474) [x86_64-darwin11.4.2]


This regex

    /[^[:space:]\d\-,\.]/

matches as expected in 1.9.3.  But in 2.0.0-p0 this regex fails to match 
unless the space class is moved later in the class.  For example, both 
of the following work as expected:

    /[^\d[:space:]\-,\.]/
    /[^\d\-,\.[:space:]]/

See 
http://stackoverflow.com/questions/15076507/regex-...
Posted by naruse (Yui NARUSE) (Guest)
on 2013-03-11 04:22
(Received via mailing list)
Issue #7972 has been updated by naruse (Yui NARUSE).

Status changed from Open to Closed

Fixed at r39547, thanks!
----------------------------------------
Bug #7972: Regex Posix space class seems location-sensitive in Ruby 
2.0.0-p0
https://bugs.ruby-lang.org/issues/7972#change-37487

Author: jdashton (J Daniel Ashton)
Status: Closed
Priority: Normal
Assignee:
Category:
Target version:
ruby -v: ruby 2.0.0p0 (2013-02-24 revision 39474) [x86_64-darwin11.4.2]


This regex

    /[^[:space:]\d\-,\.]/

matches as expected in 1.9.3.  But in 2.0.0-p0 this regex fails to match 
unless the space class is moved later in the class.  For example, both 
of the following work as expected:

    /[^\d[:space:]\-,\.]/
    /[^\d\-,\.[:space:]]/

See 
http://stackoverflow.com/questions/15076507/regex-...
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.