-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
@agalera I noticed (because of a packaging issue) that pywildcard has a second distinction with Python's fnmatch, i.e. how the resulting regular expression can be used with re.findall:
import pywildcard
regex = pywildcard.translate('example/**')
re.findall(regex, "\n".join(urls))
# return ['example/l1/l2/test3-1.py',
# 'example/l1/test2-1.py',
# 'example/l1/test2-2.py',
# 'example/l1/l2/l3/test4-1.py']The usage pattern with re.findall does not work with Python's fnmatch. Is this difference intentional or just historical? In the latter case, I would suggest to make pywildcard more similar to fnmatch again, such that the following would work:
import pywildcard
import fnmatch
assert pywildcard.translate('example/**') == fnmatch.translate('example/*')Metadata
Metadata
Assignees
Labels
No labels