mirror of
https://github.com/semver/semver.git
synced 2026-07-11 06:53:03 -05:00
Complete RegExp to verify version numbers #201
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 @rugk on GitHub (Nov 3, 2015).
Can we possibly have a full regular expression which can be used to formally verify version numbers according to the spec?
Possibly publish them at https://regex101.com/, because there you can later change (and versionize 😉) it.
This would also allow RegExp pros to just look at this RegExp and get the main ideas how to use semantic verison numbers.
@rugk commented on GitHub (Nov 3, 2015):
This would also prevent such questions: https://github.com/mojombo/semver/issues/271
Because you can easily check it by yourself. 😃
@DavidFichtmueller commented on GitHub (Nov 3, 2015):
Take a look at #232 or https://github.com/mojombo/semver/issues/266#issuecomment-135765386 (this one is better). I hope this helps.
I think this should be part of the specification as well.
@rugk commented on GitHub (Nov 3, 2015):
I also saw https://github.com/mojombo/semver/issues/32 and https://github.com/mojombo/semver.org/issues/59 which have some ideas there.
So I still leave this issue open for adding this to the spec and which would allow keeping the RegExp updated as I found many outdated RegExp in the issues you and I linked to.
@FichteFoll commented on GitHub (Nov 3, 2015):
Note that because of ambiguity in #181 we are currently unable to construct an exact regular expression, although the unpublished BNF suggests a solution.@rugk commented on GitHub (Nov 3, 2015):
As far as I understand here is a RegExp which respects the loading zeros convention.
So do you mean this with BNF or what else?Edit: Okay, found out what the BNF is. So actually you want to automatically create a RegExp out of the BNF, whcih is currently not seem possible, because the leading zeros part is missing in the BNF:
@FichteFoll commented on GitHub (Nov 3, 2015):
No, in the initial post of #181 it is explained that the spec would be ambiguous whether digits-only identifiers with leading zeros make a valid semantic version. I just came to the conclusion that it's in fact not ambiguous, so you can ignore my comment.
@haacked commented on GitHub (Aug 5, 2016):
Closing this in lieu of mojombo/semver.org#59