var semver = require('semver');

var regex = new RegExp('(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][a-zA-Z0-9-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][a-zA-Z0-9-]*))*))?(?:\\+([0-9A-Za-z-]+(?:\\.[0-9A-Za-z-]+)*))?');
function strip(range) {
	return regex.exec(range)[0];
}

exports.isNew = function isNew(version, range) {
	return (semver.satisfies(version, range) && semver.gt(version, strip(range))) || semver.gtr(version, range);
};
@@ -268,22 +268,26 @@
 nge) %7B%0A%09
-return
+var data =
  regex.e
@@ -300,64 +300,258 @@
 nge)
-%5B0%5D;%0A%7D%0A%0Aexports.isNew = function isNew(version, range) %7B
+;%0A%09if (!data %7C%7C data.length === 0) %7B%0A%09%09console.error('Could not parse invalid range: ' + range);%0A%09%09return null;%0A%09%7D%0A%0A%09return data%5B0%5D;%0A%7D%0A%0Aexports.isNew = function isNew(version, range) %7B%0A%09var clean = strip(range);%0A%09if (!clean) %7B%0A%09%09return false;%09%09%0A%09%7D%0A%09%09
 %0A%09re
@@ -611,28 +611,21 @@
 ersion, 
-strip(range)
+clean
 )) %7C%7C se

Fix for #5 incl. console output