-
Notifications
You must be signed in to change notification settings - Fork 180
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
Figure out why roxygen2 tests fail with dev stringr #99
Comments
Minimal reprex: str_replace_all('"', '(["\\\\])', "\\\\\\1")
# [1] "\\1" I'm reasonably certain the regular expression is correct, and it should return @gagolews I think this was caused by 4905b0d - I suspect this might not be a problem that regular expressions are well suited to solve, and it might be necessary to implemented a minimal parser in C++ (would need to understand character classes and |
@gagolews just wanted to check if you happened to have built any like this into stringi in the interim. Otherwise I'll start writing up more test cases |
I didn't build anything into stringi like this. |
This is a somewhat easier to understand reprex: library(stringr)
library(stringi)
# OK
str_replace_all("x", "(.)", "\\\\-\\1")
#> [1] "\\-x"
stri_replace_all_regex("x", "(.)", "\\\\-$1")
#> [1] "\\-x"
# NOT OK
str_replace_all("x", "(.)", "\\\\\\1")
#> [1] "\\1"
stri_replace_all_regex("x", "(.)", "\\\\$1")
#> [1] "\\x" |
It's something to do with new
str_replace
behaviourThe text was updated successfully, but these errors were encountered: