5 lines
173 B
TypeScript
5 lines
173 B
TypeScript
|
// regexp from https://github.com/sindresorhus/escape-string-regexp
|
||
|
export function escapeStringRegexp(str: string) {
|
||
|
return str.replace(/[|\\{}()[\]^$+*?.-]/g, '\\$&')
|
||
|
}
|