1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* regexp.c (re_compile_pattern): allow zero times match for

non-greedy range repeatation. [ruby-core:30613]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@28192 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
naruse 2010-06-07 06:14:46 +00:00
parent 3a2319f3e0
commit 9f9388e57e
4 changed files with 19 additions and 3 deletions

View file

@ -467,4 +467,9 @@ class TestRegexp < Test::Unit::TestCase
assert_equal("1", $1)
assert_equal(" " * 4999999, $2)
end
def test_range_greedy
/wo{0,3}?/ =~ "woo"
assert_equal("w", $&)
end
end