Details
-
Bug
-
Resolution: Fixed
-
P2
-
8
-
None
-
b89
-
Verified
Description
The following testcase used to capture groups, it doesn't capture anymore.
var semver = "\\s*[v=]*\\s*([0-9]+)" // major
+ "\\.([0-9]+)" // minor
+ "\\.([0-9]+)" // patch
+ "(-[0-9]+-?)?" // build
+ "([a-zA-Z-+][a-zA-Z0-9-\.:]*)?" // tag
, exprComparator = "^((<|>)?=?)\s*("+semver+")$|^$";
var validComparator = new RegExp("^"+exprComparator+"$");
// Matches should be: >=0.6.0-,>=,>,0.6.0-,0,6,0,,-
print("Matches " + ">=0.6.0-".match(validComparator));
var semver = "\\s*[v=]*\\s*([0-9]+)" // major
+ "\\.([0-9]+)" // minor
+ "\\.([0-9]+)" // patch
+ "(-[0-9]+-?)?" // build
+ "([a-zA-Z-+][a-zA-Z0-9-\.:]*)?" // tag
, exprComparator = "^((<|>)?=?)\s*("+semver+")$|^$";
var validComparator = new RegExp("^"+exprComparator+"$");
// Matches should be: >=0.6.0-,>=,>,0.6.0-,0,6,0,,-
print("Matches " + ">=0.6.0-".match(validComparator));