Actions
Backport #3403
closedA bug related to ruby's regular expression!!!!!!
Status:
Closed
Assignee:
Description
=begin
Backport r28192
I found a bug related to ruby's regular expression!
puts(/wo{0,3}?/.match("woo"))
This line of code should show a "w" on the screen, but my ruby shows "wo" on then screen.
According to the principles of regular expression, this is a non-greedy match, so it should match 0 "o", but it matches at least 1 "o". I think this is a bug!
I also tried this in the javascript language, it works well!("w" is shown)
My ruby version is v1.8.7-p249.
=end
Updated by naruse (Yui NARUSE) almost 14 years ago
- Assignee changed from shyouhei (Shyouhei Urabe) to wyhaines (Kirk Haines)
=begin
=end
Updated by wyhaines (Kirk Haines) almost 14 years ago
- Status changed from Open to Closed
- % Done changed from 0 to 100
=begin
This issue was solved with changeset r28231.
Yui, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.
=end
Actions
Like0
Like0Like0