[ruby-core:127081] [Ruby Bug#22430] regex counted group with a zero-width iteration misses a match
12 Oct
2026
12 Oct
'26
5:35 a.m.
Issue #22430 has been reported by robertmorelli (Robert Morelli). ---------------------------------------- Bug #22430: regex counted group with a zero-width iteration misses a match https://bugs.ruby-lang.org/issues/22430 * Author: robertmorelli (Robert Morelli) * Status: Open * ruby -v: ruby 4.0.7 (2026-09-15 revision 229531a6cf) +PRISM [arm64-darwin27] * Backport: 3.3: UNKNOWN, 3.4: UNKNOWN, 4.0: UNKNOWN ---------------------------------------- repro: ```ruby /\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. -- https://bugs.ruby-lang.org/
2
Age (days ago)
2
Last active (days ago)
0 comments
1 participants
participants (1)
-
robertmorelli (Robert Morelli)