Regex incompatibility between MRI and JRuby
-------------------------------------------

                 Key: JRUBY-5108
                 URL: http://jira.codehaus.org/browse/JRUBY-5108
             Project: JRuby
          Issue Type: Bug
    Affects Versions: JRuby 1.5.2
         Environment: JRuby 1.5.2, Java 6
            Reporter: Tobi Knaup
            Assignee: Thomas E Enebo
            Priority: Minor


The following simple regular expressions produce different results in MRI and 
JRuby:

p ("1 " =~ /(\d\s?){2}/)      # => nil in MRI, 0 in JRuby
p ("1 " =~ /([0-9]\s?){2}/)   # => nil in MRI, 0 in JRuby
p ("1 " =~ /(\S\s?){2}/)      # => nil in MRI, 0 in JRuby
p ("a " =~ /(\S\s?){2}/)      # => nil in MRI, 0 in JRuby
p ("a " =~ /([a-z]\s?){2}/)   # => nil in MRI, 0 in JRuby

Expected behavior is that of MRI.
These related ones produce same results:

p ("1 " =~ /(\w\s?){2}/)      # => nil
p ("a " =~ /(\w\s?){2}/)      # => nil

Tested versions:

1.9.2 p0 x86_64-darwin10.4.0
1.8.7 p174 universal-darwin10.0
1.8.6 p111 x86_64-linux
JRuby 1.5.2

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to