Project

General

Profile

Backport #2508

Updated by jeremyevans0 (Jeremy Evans) almost 5 years ago

=begin 
  
  There seems to be a bug in Ruby 1.9 regarding Regular Expression: 
 
  /(io){1}x/ =~ 'ioiox' # => 2 #fine 
  /(io){2}x/ =~ 'ioiox' # => nil #should be 0 
  /(io){2,2}x/ =~ 'ioiox'# => nil #should be 0 
  #below are correct 
  /(?:io){2}x/ =~ 'ioiox' # => 0 
  /(io){2}/ =~ 'ioiox' # => 0 
  /(io){2,}x/ =~ 'ioiox' # => 0 
  /(io){,2}x/ =~ 'ioiox' # => 0 
 
 =end 
 

Back