Please use semver-utils instead!
npm install semver-utils
See the README for semver-utils at https://github.com/coolaj86/semver-utils
npm install semver-utils
parse-semver.js
parses a single semver such as 2.1.0-6+b
. This has been tested quite a bit.
parse-semver-range.js
parses ranges such as >= 1.3.1 <= 1.4.6
. This needs more testing.
The use of "A-z" in the regex allows for the six interstitial characters between 'Z' and 'a' to be included in identifiers. (i.e. left-square-bracket, backslash, right-square-bracket, caret, underscore, and backtick). These are not legal identifier characters. Adding these two negative test cases between lines 43 and 44 demonstrates the problem:
Replacing the four instances of "A-z" with "A-Za-z" fixes this issue.