Originally created by @ykaliuta on GitHub (May 2, 2024).
Original GitHub issue: https://github.com/semver/semver/issues/1021
Looks like versions like ```1.2.3+1-2``` match the official regexp
```
/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/gm
```
but it is not part of the spec
```
<valid semver> ::= <version core>
| <version core> "-" <pre-release>
| <version core> "+" <build>
| <version core> "-" <pre-release> "+" <build>
```
This is the problem with trying to use a regex instead of a real parser. I imagine fixing this will be not particularly pretty.
<!-- gh-comment-id:2090957937 -->
@steveklabnik commented on GitHub (May 2, 2024):
This is the problem with trying to use a regex instead of a real parser. I imagine fixing this will be not particularly pretty.
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 @ykaliuta on GitHub (May 2, 2024).
Original GitHub issue: https://github.com/semver/semver/issues/1021
Looks like versions like
1.2.3+1-2match the official regexpbut it is not part of the spec
@steveklabnik commented on GitHub (May 2, 2024):
This is the problem with trying to use a regex instead of a real parser. I imagine fixing this will be not particularly pretty.
@zafarkhaja commented on GitHub (May 4, 2024):
It is part of the spec, you just need to go deeper into the
<build>identifier.@ykaliuta commented on GitHub (May 6, 2024):
True. Sorry for the noise