Uh oh!
There was an error while loading. Please reload this page.
ARROW-11513: [R] Bindings for sub/gsub - #9878
Conversation
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| if (ignore.case) { | ||
| if (fixed) { | ||
| pattern <- gsub("\\E", "\\e", pattern, fixed = TRUE) | ||
| pattern <- paste0("(?i)\\Q", pattern, "\\E") | ||
| replacement <- gsub("\\", "\\\\", replacement, fixed = TRUE) | ||
| } else { | ||
| pattern <- paste0("(?i)", pattern) | ||
| } | ||
| } |
There was a problem hiding this comment.
@maartenbreddels since ARROW-10306 did not directly support case-insensitive fixed string replacement (non-regex), this is the workaround we used to support this in the R bindings. Feedback welcome, and thanks for your work on the underlying C++ code!
nealrichardson
left a comment
There was a problem hiding this comment.
Looking close, just a few more questions
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
nealrichardson
left a comment
There was a problem hiding this comment.
+1, nice work! Will merge when CI is green-ish.
Also
stringr::str_replace()andstringr::str_replace_all()