We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e96852f commit f2d0cfdCopy full SHA for f2d0cfd
python/mlcroissant/mlcroissant/_src/core/regex.py
@@ -65,6 +65,8 @@ def _regex_to_glob_for_str(regex: str) -> Iterable[str]:
65
regex = re.sub(r"\.\*", "*", regex)
66
# Interpret .+ as *
67
regex = re.sub(r"\.\+", "*", regex)
68
+ # Interpret \\- as -
69
+ regex = re.sub(r"\\-", "-", regex)
70
return [regex]
71
72
python/mlcroissant/mlcroissant/_src/core/regex_test.py
@@ -27,6 +27,12 @@
27
"*/train/*.parquet", # ...to a valid glob pattern.
28
],
29
30
+ [
31
+ "^.+/my\\-train/.*\.parquet$", # From a valid regex...
32
33
+ "*/my-train/*.parquet", # ...to a valid glob pattern.
34
+ ],
35
36
37
)
38
def test_regex_to_glob(regex: str, output: list[str]):
0 commit comments