Skip to content

Instantly share code, notes, and snippets.

@eahrold
Last active August 29, 2015 14:11
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 eahrold/f7ae41558e379633dffe to your computer and use it in GitHub Desktop.
Save eahrold/f7ae41558e379633dffe to your computer and use it in GitHub Desktop.
Version String Detection Regex
(\d+)\.(\d+)(\.(\d+))?(\.(\d+))?(?:(?:-(alpha\d*|beta\d*|rc\d*))?)
Will detect these formats
1.21.23
1.21.23-rc
1.21.23-rc1
2.21.23-alpha
1.211.233-beta12
3.12
1.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment