|
[
Permalink
| « Hide
]
Charles Oliver Nutter added a comment - 11/Jul/08 07:02 PM
I think this has come up before and it may be an Oniguruma/Joni bug. Rubinius and Ruby 1.9 use Oniguruma, and both show the issue.
Yeah, I didn't check 1.9, but the same error in Rubinius had me guessing Joni. I searched and couldn't find the issue anywhere in JRuby's issues. Better to have it documented I guess.
Punting...not very critical, and it's an issue shared with Oniguruma. Downgrading to "major".
The issue is that Oniguruma treats quantifiers applied to anchors as invalid ones. This can be easily turned of, though, the problem is that e.g. \z+ has kind of undefined behavior (it differs among perl, ptyhon, ruby, etc).
The good news is that when this check is turned off Joni matches MRI successful matches in all weird cases (the only difference is the string index returned as a match). "\n\n\na" =~ /a/ => 3 "\n\n\na" =~ /a\z?/ => 0 JRuby would return 3 in both cases. Marcin: Is this a behavior we could have turned off by default in 1.8 mode and turned on in 1.9 mode? That would eliminate it as an incompatibility for apps that are using \z.
There is absolutely no problem doing so (via flag in RubyInstanceConfig), though, I'd guess Oniguruma on it's own or Rubinius guys are going to match 1.8 anyways here (so 1.9 is more likely to match 1.8 imho).
More precisely: (1.9 is more likely going to match 1.8 imho).
Turned out to be true, 1.9 just got a fix that allows this. Applying the exact same fix to joni (only for non-vanilla mode).
Fixed in r8218-r8220. We'll match 1.9 on all edge cases.
|
|||||||||||||||||||||||||||||||||||||||||||||||