westonpace commented on code in PR #12625:
URL: https://github.com/apache/arrow/pull/12625#discussion_r861427114


##########
cpp/src/arrow/filesystem/path_util.cc:
##########
@@ -287,6 +288,38 @@ bool IsLikelyUri(util::string_view v) {
   return ::arrow::internal::IsValidUriScheme(v.substr(0, pos));
 }
 
+struct Globber::Impl {
+  std::regex pattern_;
+
+  explicit Impl(std::string p) : pattern_(std::regex(std::move(transform(p)))) 
{}
+
+  std::string transform(std::string p) {

Review Comment:
   Looks like POSIX allows for escaping special characters in a glob:
   ```
   One can remove the special meaning of '?', '*', and '[' by
          preceding them by a backslash, or, in case this is part of a
          shell command line, enclosing them in quotes.
   ```
   
   So a user could do...
   ```
   s3://mybucket/foo/bar/\?region=utopia*
   ```
   
   That being said...the S3 filesystem is going to be matching against 
bucket/key only I think.  So the particular URL you listed isn't going to work 
as a glob expression anyways.
   
   Escaping is a concern though.  `*` is a legal character in an S3 key.



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