Project

General

Profile

Bug #3681

Character class abbreviations, + repetition notation and group backreferences issue in Regexp

Added by dre3k (Andrei Kulakov) almost 10 years ago. Updated about 9 years ago.

Status:
Closed
Priority:
Normal
Target version:
-
ruby -v:
ruby 1.9.3dev (2010-08-17 trunk 29020) [x86_64-freebsd8.1]
Backport:
[ruby-core:31677]

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

#1

Updated by naruse (Yui NARUSE) almost 10 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

#2

Updated by naruse (Yui NARUSE) almost 10 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

Also available in: Atom PDF