-
Notifications
You must be signed in to change notification settings - Fork 445
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
replace does not work against regex '^'. #393
Labels
Comments
Lapin0t
added a commit
to Lapin0t/regex
that referenced
this issue
Aug 20, 2017
Lapin0t
added a commit
to Lapin0t/regex
that referenced
this issue
Oct 15, 2017
bors
added a commit
that referenced
this issue
Nov 9, 2017
Fix `Regex::replacen` when replacing an empty match. Fixes #393, #394. There was some logic error when deciding to return `Cow::Borrowed` vs `Cow::Owned` in the fast-path. I took the same solution as the slow-path, ie use `peekable` on the iterator. I'm not sure this is the most efficient way (maybe just add `mut did_replace = false` and set it to true in the loop), but it does the job.
ethanpailes
pushed a commit
to ethanpailes/regex
that referenced
this issue
Nov 29, 2017
ethanpailes
pushed a commit
to ethanpailes/regex
that referenced
this issue
Dec 8, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I was just trying different corner cases with rust regex and I came across this one:
Code:
Above fails. and below succeeds:
Tested against 0.2.2.
I tried testing the same case with boost regex and sed and both of these yielded expected result.
The text was updated successfully, but these errors were encountered: