Skip to content

Commit

Permalink
Replace regex which allows dubble hyphens by one that does not.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Darsstar authored Jan 26, 2024
1 parent dafefbc commit 75728d6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion source/specifications/core-metadata.rst
Original file line number Diff line number Diff line change
Expand Up @@ -631,7 +631,7 @@ of lowercase ASCII letters, ASCII numbers, and hyphen. It must start and end
with a letter or number. Hyphens cannot be followed by another hyphen. Names are
limited to those which match the following regex (which guarantees unambiguity)::

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


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

0 comments on commit 75728d6

Please sign in to comment.