diff --git a/sphinx_needs/api/need.py b/sphinx_needs/api/need.py index ccfe6598b..c7aea7bd9 100644 --- a/sphinx_needs/api/need.py +++ b/sphinx_needs/api/need.py @@ -216,7 +216,7 @@ def run(): if ( needs_config.id_regex and not is_external - and not re.match(needs_config.id_regex, need_id) + and not re.fullmatch(needs_config.id_regex, need_id) ): raise NeedsInvalidException( f"Given ID '{need_id}' does not match configured regex '{needs_config.id_regex}'"