Devtools.supstudio.in

Tools/Regex

SemVer

What this is

Official SemVer has a terrifying official regex. This one covers the 99% case for changelogs and tags.

/\b\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?\b/g
1.2.3
1.2.3-beta.1
1.2.3+build.9

Open in tester

FAQ

v1.2.3?
Strip a leading v in code rather than complicating the pattern.

Related