⚲
Project
General
Profile
Sign in
Register
Home
Projects
Help
Search
:
Ruby master
All Projects
Ruby
»
Ruby master
Overview
Activity
Roadmap
Issues
Repository
Like
Download (397 Bytes)
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)
Loading...