Project

General

Profile

Actions

Bug #3681

closed

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

Added by dre3k (Andrei Kulakov) over 13 years ago. Updated almost 13 years ago.

Status:
Closed
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

Actions #1

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

Actions #2

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

Actions

Also available in: Atom PDF

Like0
Like0Like0