diff --git a/dandi/bids_validator_xs.py b/dandi/bids_validator_xs.py index ea0d82355..9ccee19cf 100644 --- a/dandi/bids_validator_xs.py +++ b/dandi/bids_validator_xs.py @@ -130,7 +130,7 @@ def _extension_safety(extension): """ if extension == "None": return "" - if "*" in extension: + if "." in extension: extension = extension.replace(".", "\\.") if "*" in extension: extension = extension.replace("*", ".*?") diff --git a/dandi/tests/test_bids_validator_xs.py b/dandi/tests/test_bids_validator_xs.py index 43d106901..4d532431a 100644 --- a/dandi/tests/test_bids_validator_xs.py +++ b/dandi/tests/test_bids_validator_xs.py @@ -98,7 +98,8 @@ def test__add_extensions(): assert ( _regex_string == "sub-(?P=subject)(|_ses-(?P=session))" "_sample-(?P([a-z,A-Z,0-9]*?))" - "(|_acq-(?P([a-z,A-Z,0-9]*?)))_photo\\.(jpg|png|tif)" + "(|_acq-(?P([a-z,A-Z,0-9]*?)))" + "_photo(\\.jpg|\\.png|\\.tif)" )