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.
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 :wink:) 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. :smiley:
@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.
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.
@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.
Note that because of ambiguity in #181 we are currently unable to construct an exact regular expression, although the unpublished BNF suggests a solution.
@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.~~
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:
@rugk commented on GitHub (Nov 3, 2015):
As far as I understand [here](https://github.com/mojombo/semver.org/issues/59#issuecomment-57841224) 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:
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.
@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.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
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