Skip to content

Commit 00e9717

Browse files
committed
Correct regex for metadata 'name' format
The current regex permits strings that end in the newline character, which is counter to what the description for the field states ("ASCII letters and numbers, period, underscore and hyphen"). This updates the rexex to use `\Z` instead of `$` to match at the end of the string and exclude newline characters.
1 parent afceaff commit 00e9717

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

source/specifications/name-normalization.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ underscore and hyphen. It must start and end with a letter or number.
1717
This means that valid project names are limited to those which match the
1818
following regex (run with :py:data:`re.IGNORECASE`)::
1919

20-
^([A-Z0-9]|[A-Z0-9][A-Z0-9._-]*[A-Z0-9])$
20+
^([A-Z0-9]|[A-Z0-9][A-Z0-9._-]*[A-Z0-9])\Z
2121

2222

2323
.. _name-normalization:

0 commit comments

Comments
 (0)