Created
March 20, 2023 08:58
-
-
Save georgekosmidis/c13a1ee04766918eddc7fd3aacd13c47 to your computer and use it in GitHub Desktop.
Suggested regular expression (RegEx) to check a SemVer string for BASH, as described in https://semver.org/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Suggested regular expression (RegEx) to check a SemVer string for BASH | |
| # as described in https://semver.org/ | |
| # Test here: https://regex101.com/r/qfrSak/1 | |
| ^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(-((0|[1-9][0-9]*|[0-9]*[a-zA-Z-][0-9a-zA-Z-]*)(\.(0|[1-9][0-9]*|[0-9]*[a-zA-Z-][0-9a-zA-Z-]*))*))?(\+([0-9a-zA-Z-]+(\.[0-9a-zA-Z-]+)*))?$ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment