UNPKG

@stream-io/escape-string-regexp

Version:

Escape RegExp special characters

3 lines (2 loc) 196 B
module.exports=function(e){if("string"!=typeof e)throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}; //# sourceMappingURL=index.cjs.map