Skip to content

Commit 75728d6

Browse files
authored
Replace regex which allows dubble hyphens by one that does not.
The current version disallows tripple hyphens but allows dubble hyphens. (It also seems overcomplicated) Alternatively we can make it a negative lookbehind instead of a negative lookahead, but the complexity is much higher. See https://regex101.com/r/Xyu0bt/1 for proof the current version matches double hyphens
1 parent dafefbc commit 75728d6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

source/specifications/core-metadata.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -631,7 +631,7 @@ of lowercase ASCII letters, ASCII numbers, and hyphen. It must start and end
631631
with a letter or number. Hyphens cannot be followed by another hyphen. Names are
632632
limited to those which match the following regex (which guarantees unambiguity)::
633633

634-
^([a-z0-9]|[a-z0-9]([a-z0-9-](?!--))*[a-z0-9])$
634+
^[a-z0-9]+(-[a-z0-9]+)*$
635635

636636

637637
The specified name may be used to make a dependency conditional on whether the

0 commit comments

Comments
 (0)