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

Add a replace function that supports regex #1393

Merged
merged 5 commits into from
Nov 8, 2022

Conversation

miles170
Copy link
Contributor

@miles170 miles170 commented Oct 29, 2022

Add replace_regex(s, from, to) that supports replacing text using regular expressions.

Closes #1389.

@ianpittwood
Copy link

LGTM! Thanks for taking this on!

@casey
Copy link
Owner

casey commented Nov 8, 2022

Thanks for this, and sorry I've been so slow to review it! Can you add a test for the error case? I want to make sure the error message looks good. If the regex crate's error message doesn't show the original regex, we should include that as well.

@casey casey enabled auto-merge (squash) November 8, 2022 06:45
@miles170
Copy link
Contributor Author

miles170 commented Nov 8, 2022

There is a typo in the README. (regec -> regex)

@casey casey merged commit 7d6483b into casey:master Nov 8, 2022
@miles170 miles170 deleted the issue-1389-replace_regex branch November 8, 2022 06:48
@casey
Copy link
Owner

casey commented Nov 8, 2022

Good catch! Fixing here: #1409.

Tweaked the argument names and added an entry in the readme. I also removed the error prefix, I think the underlying error is probably descriptive enough. Thank you for the PR!

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.

Add a replace function that supports regex
3 participants