Skip to content

Fix appendReplacement validation#204

Open
cushon wants to merge 1 commit into
google:masterfrom
cushon:appendReplacement
Open

Fix appendReplacement validation#204
cushon wants to merge 1 commit into
google:masterfrom
cushon:appendReplacement

Conversation

@cushon
Copy link
Copy Markdown
Contributor

@cushon cushon commented May 22, 2026

Strictly validate replacement strings in Matcher.appendReplacement to match java.util.regex behavior.

Throw IllegalArgumentException for trailing $ or \, invalid group references, and invalid named group syntax.

Closes #196

Strictly validate replacement strings in Matcher.appendReplacement to match java.util.regex behavior.

Throw IllegalArgumentException for trailing $ or \, invalid group references, and invalid named group syntax.

Closes google#196
@cushon cushon changed the title Fix appendReplacement validation in RE2J. Fix appendReplacement validation May 22, 2026
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.

appendReplacement doesn't throw for invalid replacement groups

1 participant