@joar 
I see two options here:
- Convert the glob into a regex instead. Something like: `re.sub(r'\*', 
r'[^/\\\\]*', pattern)`, but it's more complicated because of special 
characters that need escaping. See how it's done in Java SDK: 
https://github.com/apache/beam/blob/279a05604b83a54e8e5a79e13d8761f94841f326/sdks/java/extensions/google-cloud-platform-core/src/main/java/org/apache/beam/sdk/util/GcsUtil.java#L155
- Use Python 3's pathlib (PurePath.match()), falling back on 
[pathlib2](https://pypi.org/project/pathlib2/) in Python 2.

I'm leaning towards the second option, since it's less code to maintain and 
uses standard libraries in Python 3.

[ Full content available at: https://github.com/apache/beam/pull/6423 ]
This message was relayed via gitbox.apache.org for [email protected]

Reply via email to