-
Notifications
You must be signed in to change notification settings - Fork 450
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
Improper Regex::replace behaviour #291
Comments
BurntSushi
added a commit
to BurntSushi/regex
that referenced
this issue
Oct 27, 2016
This is another variant of incorrectly producing an unambiguous set of literals. Fixes rust-lang#291.
@ConnorGray Thanks again for the bug report! This should be fixed in |
@BurntSushi Thanks again for the quick fix! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The regular express
((IMG|CAM|MG|MB2)_|(DSCN|CIMG))(?P<n>[0-9]+)$
is a match on the text"CIMG2341"
but expected result ofregex.replace("CIMG2341", "$n")
returns"2341"
is not found, instead"CIMG2341"
is returned. The correct behavior is observer when the original regex is replaced with((MG|MB2)_|(DSCN|CIMG))(?P<n>[0-9]+)$
.The text was updated successfully, but these errors were encountered: