Development

Semantic Versioning (SemVer)

Matches standard SemVer strings (X.Y.Z)

/^(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-]+)*))?$/

Type in the box above to test if your input matches the regex pattern.

Test Cases

1.0.0
2.1.3-alpha.1
1.0.0+20130313144700
1.0
v1.0.0
1.0.0.0

Tags

#dev #version #release