Skip to content

Commit

Permalink
Close GH-3: fix issue allowing leading zeroes in major, minor and pat…
Browse files Browse the repository at this point in the history
…ch. Fixes #2
  • Loading branch information
Fabien Dehopré authored and sindresorhus committed Jul 20, 2014
1 parent 18ea9db commit 795b056
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
'use strict';
module.exports = function () {
return /v?\d+\.\d+\.\d+(?:-[\da-z\-]+(?:\.[\da-z\-]+)*)?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?/ig;
return /\bv?(?:0|[1-9][0-9]*)\.(?:0|[1-9][0-9]*)\.(?:0|[1-9][0-9]*)(?:-[\da-z\-]+(?:\.[\da-z\-]+)*)?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?\b/ig;
};

0 comments on commit 795b056

Please sign in to comment.