Actions
Bug #22430
openregex counted group with a zero-width iteration misses a match
Bug #22430:
regex counted group with a zero-width iteration misses a match
Status:
Open
Assignee:
-
Target version:
-
ruby -v:
ruby 4.0.7 (2026-09-15 revision 229531a6cf) +PRISM [arm64-darwin27]
Description
repro:
/\A(?:a|^){2}\z/.match?("a") # true
/\A(?:a|^){2,3}\z/.match?("a") # false
/\A(?:\B|a){3}\z/.match?("aa") # false
/\A(?:^a*){2,3}\z/.match?("a") # false
Perl and Python return true for all four. Possibly same family as #22418.
No data to display
Actions