refactor(util) escapeRegExp

This commit is contained in:
coderaiser 2014-05-14 07:15:18 -04:00
parent fc3c8b6892
commit 1b663e9bdf

View file

@ -529,14 +529,13 @@
return conv;
};
this.escapeRegExp = function(pStr) {
var ret = pStr,
isStr = Util.isString(pStr);
this.escapeRegExp = function(str) {
var isStr = Util.isString(str);
if (isStr)
ret = pStr.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
str = str.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
return ret;
return str;
};
/**