Skip to content

Honor NeverCapture for named capturing groups - #701

Open
powerman2026 wants to merge 1 commit into
google:mainfrom
powerman2026:fix/named-never-capture
Open

powerman2026 wants to merge 1 commit into
google:mainfrom
powerman2026:fix/named-never-capture

Conversation

@powerman2026

Copy link
Copy Markdown

Fixes #699. Apply NeverCapture at the shared capturing-parenthesis entry point, after named groups have validated their names. Previously only the anonymous-group parser consulted the option, so named groups still consumed capture slots and appeared in both capture-name maps.

The regression exercises both supported named-group syntaxes, mixed named/anonymous groups, matching with captures disabled, normal captures with the option off, and rejection of an invalid name. It failed on main. All 20 CMake test executables passed on macOS arm64, including the exhaustive suites.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RE2::Options::never_capture does not treat named capturing groups (?P<name>...) / (?<name>...) as non-capturing

1 participant