Revert "improve efficiency of _glob_to_re"
This reverts commit edac710bc0.
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user