Skip to content
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

Management of backreferences in the str.replace function #6637

Closed
BastienRance opened this issue Oct 31, 2020 · 1 comment
Closed

Management of backreferences in the str.replace function #6637

BastienRance opened this issue Oct 31, 2020 · 1 comment
Labels
feature request New feature or request

Comments

@BastienRance
Copy link

BastienRance commented Oct 31, 2020

Hello,

Thanks for a great library!

It would be fantastic if the str.replace function could manage backreferences (as in \1 in regex).
An example of use could be:
Remove duplicated characters from a string

test = "RROBBERRT"
test = test.replace('([A-Z1-9])\1', '\1')
print(test)

Thanks!

@BastienRance BastienRance added Needs Triage Need team to review and classify feature request New feature or request labels Oct 31, 2020
@BastienRance
Copy link
Author

Just realized that Issue #3100 already answer this request!

@bdice bdice removed the Needs Triage Need team to review and classify label Mar 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants