ianmcook commented on a change in pull request #10190:
URL: https://github.com/apache/arrow/pull/10190#discussion_r623913940



##########
File path: r/R/dplyr.R
##########
@@ -410,6 +410,17 @@ build_function_list <- function(FUN) {
         options = list(null_encoding_behavior = null_encoding_behavior)
       )
     },
+    strsplit = function(x, split, fixed = FALSE, perl = FALSE, useBytes = 
FALSE){
+      
+      regex_metachars <- c(".", "\\", "|", "(", ")", "[", "{", "^", "$", "*", 
"+", "?")
+      is_regex <- any(map_lgl(regex_metachars, ~grepl(.x, split, fixed = 
TRUE)))

Review comment:
       I think you can simplify this like so
   ```suggestion
         is_regex <- grepl("[.\\|()[{^$*+?]", split)
   ```
   this should work because in a regular expression, inside a square bracket 
character class, these special characters are interpreted as literals (as 
explained at https://stackoverflow.com/a/19976308/375432)
   
   But please sanity check this; I could be missing something




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to