edponce commented on a change in pull request #11233:
URL: https://github.com/apache/arrow/pull/11233#discussion_r728484596



##########
File path: cpp/src/arrow/compute/kernels/scalar_string.cc
##########
@@ -2601,10 +2625,11 @@ struct RegexSubStringReplacer {
 
   // Using RE2::FindAndConsume we can only find the pattern if it is a group, 
therefore
   // we have 2 regexes, one with () around it, one without.
-  explicit RegexSubStringReplacer(const ReplaceSubstringOptions& options)
+  explicit RegexSubstringReplacer(const ReplaceSubstringOptions& options)
       : options_(options),
-        regex_find_("(" + options_.pattern + ")", RE2::Quiet),
-        regex_replacement_(options_.pattern, RE2::Quiet) {}
+        regex_find_("(" + options_.pattern + ")",
+                    Type::is_utf8 ? RE2::Quiet : RE2::Latin1),
+        regex_replacement_(options_.pattern, Type::is_utf8 ? RE2::Quiet : 
RE2::Latin1) {}

Review comment:
       We can't OR them (these enums increment by 1) but [we can definitely set 
both of 
them](https://github.com/apache/arrow/pull/11233/files#diff-eb8300bc4dea7d1c46b2576b7dbd8e42b927ab7d42c031f4aecae892a72ee244R989-R993)
 since there are more than simply code-point errors.




-- 
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.

To unsubscribe, e-mail: [email protected]

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


Reply via email to