Skip to content

add group capture to replace #1788

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

cboseak
Copy link

@cboseak cboseak commented Jun 3, 2025

Fixes #1760

Description

Per issue #1760's request, this is a feature to have Replace function support the group capture in the replacement string


Important Notes

  • In Rust's regex implementation, the replacement string syntax is custom and not identical to Perl or other languages that use backslash (\1, \2, etc.) for backreferences in replacement strings. Instead $1 $2 is valid for a group replace string.
    • \1 replace syntax was converted to $1 syntax to allow that

Testing

  • added tests
  • all tests passing

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.

normalizers.Replace able to support regex group capture
1 participant