[GH-ISSUE #45] Dashes in pre-release and build version #5152

Closed
opened 2026-06-15 11:05:34 -05:00 by GiteaMirror · 2 comments
Owner

Originally created by @sunsided on GitHub (Aug 30, 2012).
Original GitHub issue: https://github.com/semver/semver/issues/45

2.0.0-rc.1 states in §10 and §11 that " Identifiers MUST be comprised of only ASCII alphanumerics and dash [0-9A-Za-z-]". This suggests that the pre-release or build part may contain a dash. Since there is no fixed order defined for these parts (apart from precedence calculation in §12), either 0.1.2-alpha-2+b232-3 and 0.1.2+b232-3-alpha-2 would be considered valid, making it impossible to distinguish the version parts.

Originally created by @sunsided on GitHub (Aug 30, 2012). Original GitHub issue: https://github.com/semver/semver/issues/45 2.0.0-rc.1 states in §10 and §11 that " Identifiers MUST be comprised of only ASCII alphanumerics and dash `[0-9A-Za-z-]`". This suggests that the pre-release or build part may contain a dash. Since there is no fixed order defined for these parts (apart from precedence calculation in §12), either `0.1.2-alpha-2+b232-3` and `0.1.2+b232-3-alpha-2` would be considered valid, making it impossible to distinguish the version parts.
Author
Owner

@lukaszmoroz commented on GitHub (Aug 30, 2012):

"9. A pre-release version MAY be denoted by appending a hyphen and a series of dot separated identifiers immediately following the patch version."

Emphasis mine. The pre-release part must be first, so there is no ambiguity.

<!-- gh-comment-id:8173992 --> @lukaszmoroz commented on GitHub (Aug 30, 2012): "9. A pre-release version MAY be denoted by appending a hyphen and a series of dot separated identifiers **immediately following the patch version**." Emphasis mine. The pre-release part must be first, so there is no ambiguity.
Author
Owner

@sunsided commented on GitHub (Sep 1, 2012):

You're right.

<!-- gh-comment-id:8214443 --> @sunsided commented on GitHub (Sep 1, 2012): You're right.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/semver#5152