mirror of
https://github.com/semver/semver.git
synced 2026-07-11 03:53:53 -05:00
[GH-ISSUE #702] Regex from semver.org not matching 0.0.1-SNAPSHOT.I.0285680 #2208
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @shoelzle on GitHub (May 14, 2021).
Original GitHub issue: https://github.com/semver/semver/issues/702
The version
0.0.1-SNAPSHOT.I.0285680is not a valid semantic version.The problem is the
0after the dot, hence0.0.1-SNAPSHOT.I.1285680matches just fine.But why must multiple digits in a numeric identifier not start with a zero ?
The relevant part from the semver.org BNF:
@dtonhofer commented on GitHub (May 17, 2021):
I would say, because if it's a number, it should be written canonically, without any leading zeros.
@shoelzle commented on GitHub (May 19, 2021):
My mistake:
The suffix
0285680is an example of a short commit sha and as such it is just not semver compliant to put it in thepre-releasepart of the BNF because it is not anumeric identifier. But it is abuild identifier, so the following versions are semver compliant:0.0.1-SNAPSHOT+I.02856800.0.1-SNAPSHOT+I.1285680Thanks for the hint.