Open HuguesRoy opened 4 months ago
Fix issue #1163
Change re.search by re.match.
re.search
re.match
It will avoid hidden file matching by constraining to an exact match with the pattern
if we have two files:
ADNIMERGE_25Apr2024.csv
.ADNIMERGE_25Apr2024.csv
the pattern is "ADNIMERGE"+ r"(_\d{1,2}[A-Za-z]{3}\d{4})?.csv", only the correct file will be returned.
"ADNIMERGE"+ r"(_\d{1,2}[A-Za-z]{3}\d{4})?.csv"
I would prefer changing the rglob regex to not consider hidden files at all (either check on beginning of string or different rglob match but I would need to check how to). WDYT @NicolasGensollen ?
Fix issue #1163
Change
re.search
byre.match
.It will avoid hidden file matching by constraining to an exact match with the pattern
if we have two files:
ADNIMERGE_25Apr2024.csv
.ADNIMERGE_25Apr2024.csv
the pattern is
"ADNIMERGE"+ r"(_\d{1,2}[A-Za-z]{3}\d{4})?.csv"
, only the correct file will be returned.