String.scan() doesn't set $1, $2, ...
-------------------------------------

                 Key: JRUBY-872
                 URL: http://jira.codehaus.org/browse/JRUBY-872
             Project: JRuby
          Issue Type: Bug
          Components: Core Classes/Modules
    Affects Versions: JRuby 0.9.9, JRuby 0.9.8
         Environment: Mac OS X 10.4.9, running Java 1.5.0_07, and JRuby 0.9.8 
and 0.9.9
            Reporter: Andrew Geweke


The following snippet of Ruby code, on MRI (native Ruby), prints:

Scanned: oo
Matched: oo

...but JRuby prints:

Scanned:
Matched: oo

JRuby is not setting $1 correctly after String.scan is called. (This is 
assuming the canonical spec of how Ruby works is MRI, which is my 
understanding.)

I will try to create a testcase and patch and upload them here shortly, but I 
wanted to make sure the bug didn't slip through the cracks in any case...

-------- snippet follows ----------

TestString = "foobar"

TestString.scan(/(o+)/)
puts "Scanned: #{$1}"

TestString =~ /(o+)/
puts "Matched: #{$1}"


-- 
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