regex for semantic versioning

match a SemVer string

Match a SemVer as specified in https://semver.org/

Semantic Versioning is a versioning system that has been adapted to bring sanity to the management of rapidly moving software release targets. This expression can be used to find or validate a semantic version numbers.

The basic expression has 3 numbers which represent Major Version, Minor Version and Patches.

Pre-release metadata is represented by appending a hyphen(-) and the name.


Cheatsheet

expr usage
iHateRegex
by geon