Skip to content

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

Copy link
Collaborator

@ArthurZucker ArthurZucker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually down for this! Do you mind updating the bindings as well?

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

normalizers.Replace able to support regex group capture

2 participants