Revert "improve efficiency of _glob_to_re"

This reverts commit edac710bc0.
This commit is contained in:
Brendan Abolivier 2021-05-11 10:49:45 +01:00
parent 7865bc1dfb
commit 6157f02067
No known key found for this signature in database
GPG key ID: 1E015C145F1916CD

View file

@ -230,8 +230,7 @@ def _glob_to_re(glob: str, word_boundary: bool) -> Pattern:
if IS_GLOB.search(glob):
r = re.escape(glob)
# replace 1 or more repeats of `\*` with `.*?`
r = re.sub(r"(\\\*)+", ".*?", r)
r = r.replace(r"\*", ".*?")
r = r.replace(r"\?", ".")
# handle [abc], [a-z] and [!a-z] style ranges.