From 52efd6c2fd67bbef8d2cfcc44e44120917265c42 Mon Sep 17 00:00:00 2001 From: = <=> Date: Tue, 2 Sep 2025 10:17:17 -0400 Subject: [PATCH] Regulator Function fixed --- utils/pathfunctions.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/utils/pathfunctions.py b/utils/pathfunctions.py index 0856788..2c8fab8 100644 --- a/utils/pathfunctions.py +++ b/utils/pathfunctions.py @@ -142,11 +142,12 @@ def inspect_parquet(path): 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] pattern = "(?:" + "|".join(escaped) + ")" if case_insensitive: - pattern = pattern - print(f"Regulator is providing {pattern}") - return f'r"{pattern}"' + pattern = "(?i)" + pattern # Add inline case-insensitive flag + print(f"Regulator is providing: {pattern}") + return pattern +