Skip to content

Instantly share code, notes, and snippets.

@jhorsman
Last active March 29, 2024 05:25
Show Gist options
  • Select an option

  • Save jhorsman/62eeea161a13b80e39f5249281e17c39 to your computer and use it in GitHub Desktop.

Select an option

Save jhorsman/62eeea161a13b80e39f5249281e17c39 to your computer and use it in GitHub Desktop.

Revisions

  1. jhorsman revised this gist Dec 7, 2016. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions semver-regex.md
    Original file line number Diff line number Diff line change
    @@ -1,10 +1,10 @@
    # Semantic versioning regex

    ´´´ ^([0-9]+)\.([0-9]+)\.([0-9]+)(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?(?:\+[0-9A-Za-z-]+)?$ ´´´
    ``` ^([0-9]+)\.([0-9]+)\.([0-9]+)(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?(?:\+[0-9A-Za-z-]+)?$ ```

    ## example
    http://regexr.com/3er1i

    ## also see
    Semantic versioning http://semver.org/
    Source of the regex https://github.com/npm/node-semver/issues/32
    * Semantic versioning http://semver.org/
    * Source of the regex https://github.com/npm/node-semver/issues/32
  2. jhorsman created this gist Dec 7, 2016.
    10 changes: 10 additions & 0 deletions semver-regex.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,10 @@
    # Semantic versioning regex

    ´´´ ^([0-9]+)\.([0-9]+)\.([0-9]+)(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?(?:\+[0-9A-Za-z-]+)?$ ´´´

    ## example
    http://regexr.com/3er1i

    ## also see
    Semantic versioning http://semver.org/
    Source of the regex https://github.com/npm/node-semver/issues/32