summaryrefslogtreecommitdiff
path: root/program/js/common.js
diff options
context:
space:
mode:
Diffstat (limited to 'program/js/common.js')
-rw-r--r--program/js/common.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/program/js/common.js b/program/js/common.js
index d9216a58d..da1c09225 100644
--- a/program/js/common.js
+++ b/program/js/common.js
@@ -624,3 +624,11 @@ var bw = new roundcube_browser();
if (!window.console)
console = new rcube_console();
+
+
+// Add escape() method to RegExp object
+// http://dev.rubyonrails.org/changeset/7271
+RegExp.escape = function(str)
+ {
+ return String(str).replace(/([.*+?^=!:${}()|[\]\/\\])/g, '\\$1');
+ }