Bug #3681
closedCharacter class abbreviations, + repetition notation and group backreferences issue in Regexp
Description
=begin
There seems to be a bug in Ruby 1.9.2 rc2 regarding Regular Expression
/([A-Z][a-z]+){2}/ =~ 'TestString' # => 0 #correct
/([A-Z]\w+){2}/ =~ 'TestString' # => nil #should be 0
/(A-Z+){2}/ =~ 'TestString' # => 0 #correct
/(A-Z+){2}/ =~ 'TestString' # => nil #should be 0
/([A-Z]\w{1,10}){2}/ =~ 'TestString' # => 0 #correct
/([A-Z]\w{1,}){2}/ =~ 'TestString' # => nil #should be 0
Ruby 1.9.1 p429 yields correct result
/([A-Z][a-z]+){2}/ =~ 'TestString' # => 0 #correct
/([A-Z]\w+){2}/ =~ 'TestString' # => 0 #correct
/(A-Z+){2}/ =~ 'TestString' # => 0 #correct
/(A-Z+){2}/ =~ 'TestString' # => 0 #correct
/([A-Z]\w{1,10}){2}/ =~ 'TestString' # => 0 #correct
/([A-Z]\w{1,}){2}/ =~ 'TestString' # => 0 #correct
=end
Updated by naruse (Yui NARUSE) over 13 years ago
- Assignee set to naruse (Yui NARUSE)
- ruby -v set to ruby 1.9.3dev (2010-08-17 trunk 29020) [x86_64-freebsd8.1]
=begin
I can reproduce this, I'll fix it.
=end
Updated by naruse (Yui NARUSE) over 13 years ago
- Status changed from Open to Closed
- % Done changed from 0 to 100
=begin
This issue was solved with changeset r29023.
Andrei, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.
=end