Project

General

Profile

Bug #15583 ยป t.rb

Test script showing confusing behavior of /{n}?/ - davisjam (James Davis), 02/01/2019 03:14 PM

 
if /a{1,}?/.match("")
puts "a{1,}? matched the empty string"
else
puts "a{1,}? did not match"
end

if /a{1,3}?/.match("")
puts "a{1,3}? matched the empty string"
else
puts "a{1,3}? did not match"
end

if /a{,1}?/.match("")
puts "a{,1}? matched the empty string"
else
puts "a{,1}? did not match"
end

if /a{1}?/.match("")
puts "a{1}? matched the empty string"
else
puts "Did not match"
end
    (1-1/1)