Regulator Function fixed
This commit is contained in:
@@ -142,11 +142,12 @@ def inspect_parquet(path):
|
|||||||
|
|
||||||
def regulator(paths, case_insensitive=True):
|
def regulator(paths, case_insensitive=True):
|
||||||
"""
|
"""
|
||||||
Build a Python raw string regex that matches any of the given Windows path fragments.
|
Build a regex pattern that matches any of the given Windows path fragments.
|
||||||
"""
|
"""
|
||||||
escaped = [re.escape(p) for p in paths]
|
escaped = [re.escape(p) for p in paths]
|
||||||
pattern = "(?:" + "|".join(escaped) + ")"
|
pattern = "(?:" + "|".join(escaped) + ")"
|
||||||
if case_insensitive:
|
if case_insensitive:
|
||||||
pattern = pattern
|
pattern = "(?i)" + pattern # Add inline case-insensitive flag
|
||||||
print(f"Regulator is providing {pattern}")
|
print(f"Regulator is providing: {pattern}")
|
||||||
return f'r"{pattern}"'
|
return pattern
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user