1 // Thanks to Andrew Clover:
2 // http://stackoverflow.com/questions/3561493
3 // /is-there-a-regexp-escape-function-in-javascript
7 var re = /[\-\/\\\^$*+?.()|\[\]{}]/g;
9 module.exports = function (str) { return String(str).replace(re, '\\$&'); };