Skip to content

[branch-52] Fix incorrect regex pattern in regex_replace_posix_groups (#19827)#21396

Open
alamb wants to merge 1 commit intoapache:branch-52from
alamb:alamb/backport_19827
Open

[branch-52] Fix incorrect regex pattern in regex_replace_posix_groups (#19827)#21396
alamb wants to merge 1 commit intoapache:branch-52from
alamb:alamb/backport_19827

Conversation

@alamb
Copy link
Copy Markdown
Contributor

@alamb alamb commented Apr 6, 2026

The `regex_replace_posix_groups` method was using the pattern `(\d*)` to
match
POSIX capture group references like `\1`. However, `*` matches zero or
more
digits, which caused a lone backslash `\` to incorrectly become `${}`.

Changed to `(\d+)` which requires at least one digit, fixing the issue.

Added unit tests to validate correct behavior.

- Fixes apache#19766

---------

Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
@github-actions github-actions bot added the functions Changes to functions implementation label Apr 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

functions Changes to functions implementation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants