Project

General

Profile

Actions

Bug #22418

open

Regex counted repetition disagrees with expanded equivalent pattern

Bug #22418: Regex counted repetition disagrees with expanded equivalent pattern

Added by robertmorelli (Robert Morelli) about 4 hours ago.

Status:
Open
Assignee:
-
Target version:
-
ruby -v:
ruby 4.0.7 (2026-09-15 revision 229531a6cf) +PRISM [arm64-darwin27]
[ruby-core:127015]

Description

repro:

/(?: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.

No data to display

Actions

Also available in: PDF Atom