Skip to content

Instantly share code, notes, and snippets.

@niksudan
Created April 13, 2017 10:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save niksudan/5cad09e351031a04b17d315b6dfc9716 to your computer and use it in GitHub Desktop.
Save niksudan/5cad09e351031a04b17d315b6dfc9716 to your computer and use it in GitHub Desktop.
Semver Regex
^(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)(?:-([a-z]+))?(\.(?:0|[1-9]\d*)
@jwdonahue
Copy link

Not a very useful regex, see:

https://regex101.com/r/bcq5Jd/1/

It's also a naive approach to the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment