Version 1
[yaffs-website] / node_modules / underscore.string / helper / escapeRegExp.js
diff --git a/node_modules/underscore.string/helper/escapeRegExp.js b/node_modules/underscore.string/helper/escapeRegExp.js
new file mode 100644 (file)
index 0000000..01097fb
--- /dev/null
@@ -0,0 +1,5 @@
+var makeString = require('./makeString');
+
+module.exports = function escapeRegExp(str) {
+  return makeString(str).replace(/([.*+?^=!:${}()|[\]\/\\])/g, '\\$1');
+};