fix Ox.replaceRegExp

This commit is contained in:
rolux 2012-05-26 23:15:09 +02:00
parent 4f65c927c5
commit 68c06a76bf

View file

@ -5,5 +5,5 @@ Ox.escapeRegExp <f> Escapes a string for use in a regular expression
@*/
// see https://developer.mozilla.org/en/JavaScript/Guide/Regular_Expressions
Ox.escapeRegExp = function(string) {
return (string + '').replace(/([\/\\^$*+?.-|(){}[\]])/g, '\\$1');
return (string + '').replace(/([\/\\\^\$\*\+\?\.\-\|\(\)\{\}\[\]])/g, '\\$1');
};