ArianaVillegas commented on code in PR #12625:
URL: https://github.com/apache/arrow/pull/12625#discussion_r863929623
##########
cpp/src/arrow/filesystem/path_util.cc:
##########
@@ -287,6 +288,42 @@ bool IsLikelyUri(util::string_view v) {
return ::arrow::internal::IsValidUriScheme(v.substr(0, pos));
}
+struct Globber::Impl {
+ std::regex pattern_;
+
+ explicit Impl(const std::string& p) :
pattern_(std::regex(PatternToRegex(p))) {}
+
+ std::string PatternToRegex(const std::string& p) {
+ std::string special_chars_ = "()[]{}+-|^$\\.&~# \t\n\r\v\f";
+ std::string transformed;
+ for (char c : p) {
+ if (c == '*') {
+ if (transformed.back() != '\\')
Review Comment:
As far as I know, `back()` in an empty string return a null char (0), so it
can be compared to other chars. If you agree, I think we can keep current code
structure.
--
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]