[MacRuby-devel] regex error with negative look-ahead and look-behind

Alan Skipp al_skipp at fastmail.fm
Tue Dec 21 14:01:31 PST 2010


When combining negative look-ahead with look-behind in a regexp, macruby doesn't match correctly. Here's an example.

ruby 1.9.2
>> m = "abc123abc".match /(?<=\w) (\d{3}) (?!\d)/x
 => #<MatchData "123" 1:"123"> 
>> m.to_s
 => "123" 


macruby (0.9)
>> m = "abc123abc".match /(?<=\w) (\d{3}) (?!\d)/x
=> #<MatchData "" 1:"123">
>> m.to_s
=> ""




More information about the MacRuby-devel mailing list