[ruby-core:127015] [Ruby Bug#22418] Regex counted repetition disagrees with expanded equivalent pattern
8 Oct
2026
8 Oct
'26
2:20 p.m.
Issue #22418 has been reported by robertmorelli (Robert Morelli). ---------------------------------------- Bug #22418: Regex counted repetition disagrees with expanded equivalent pattern https://bugs.ruby-lang.org/issues/22418 * 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 /(?:u|\b){3}d/.match?("uud") # false /(?:u|\b)(?:u|\b)(?:u|\b)d/.match?("uud") # true ``` The counted repetition should be equivalent to duplicating the group but it is not. -- https://bugs.ruby-lang.org/
15
Age (days ago)
15
Last active (days ago)
0 comments
1 participants
participants (1)
-
robertmorelli (Robert Morelli)