From e038916fe397368a7fee8ffa86dbd6c025b8d993 Mon Sep 17 00:00:00 2001 From: Ruben Rodriguez Date: Fri, 11 May 2018 13:21:18 -0400 Subject: Regexp matches at stripLicenseToRegexp should be non-global Global matching results in alternating true/false results as explained in https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/test (Using test() on a regex with the global flag) --- legacy_license_check.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/legacy_license_check.js b/legacy_license_check.js index 00d341e..f783129 100644 --- a/legacy_license_check.js +++ b/legacy_license_check.js @@ -40,7 +40,7 @@ var stripLicenseToRegexp = function (license) { item = license.licenseFragments[i]; item.regex = match_utils.removeNonalpha(item.text); item.regex = new RegExp( - match_utils.replaceTokens(item.regex), 'g'); + match_utils.replaceTokens(item.regex), ''); } return license; }; -- cgit v1.2.3