diff --git a/tools/schemacode/bidsschematools/rules.py b/tools/schemacode/bidsschematools/rules.py index dd5353a0b5..37592618a7 100644 --- a/tools/schemacode/bidsschematools/rules.py +++ b/tools/schemacode/bidsschematools/rules.py @@ -124,7 +124,7 @@ def _entity_rule(rule: Mapping, schema: bst.types.Namespace): ext_regex = f"(?P{ext_match})" return { - "regex": "".join(dir_regex + entity_regex + [suffix_regex, ext_regex]), + "regex": "".join(dir_regex + entity_regex + [suffix_regex, ext_regex, "$"]), "mandatory": False, }