Merge pull request #4177 from dloverin/pref-regexp-fix

do not wrap regular expresssions in '^' and '$', only strings.
This commit is contained in:
Erik Tierney committed 2013-06-14 06:32:54 -07:00
commit 5435d4092e
3 files changed
+6 -3

No files matched your search

@@ -106,14 +106,16 @@ define(function (require, exports, module) {
// since we know it is a wildcard.
value = value.replace("\\?", ".?");
value = value.replace("\\*", ".*");
// Add "^" and "$" to prevent matching in the middle of strings.
value = "^" + value + "$";
}
if (index > 0) {
regExpString += "|";
}
// Add "^" and "$" to prevent matching in the middle of strings.
regExpString = regExpString.concat("^" + value + "$");
regExpString = regExpString.concat(value);
}
});
}