ARROW-11513: [R] Bindings for sub/gsub#9878
Closed
ianmcook wants to merge 19 commits intoapache:masterfrom
Closed
Conversation
ianmcook
commented
Apr 5, 2021
Comment on lines
443
to
451
| 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) | ||
| } | ||
| } |
Member
Author
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!
Member
Author
There was a problem hiding this comment.
Comments added explaining this code in db828be
Member
nealrichardson
left a comment
There was a problem hiding this comment.
Looking close, just a few more questions
nealrichardson
approved these changes
Apr 6, 2021
Member
nealrichardson
left a comment
There was a problem hiding this comment.
+1, nice work! Will merge when CI is green-ish.
pachadotdev
pushed a commit
to pachadotdev/arrow
that referenced
this pull request
Apr 6, 2021
Also `stringr::str_replace()` and `stringr::str_replace_all()` Closes apache#9878 from ianmcook/ARROW-11513 Lead-authored-by: Ian Cook <[email protected]> Co-authored-by: Neal Richardson <[email protected]> Signed-off-by: Neal Richardson <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Also
stringr::str_replace()andstringr::str_replace_all()