do not wrap regular expresssions in '^' and '$', only strings.

This commit is contained in:
dloverin committed 2013-06-10 09:03:06 -04:00
1 parent 37f4ffd324
commit fccdb12b02
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);
}
});
}