rsnext/packages/next/shared/lib/escape-regexp.ts

5 lines
173 B
TypeScript
Raw Normal View History

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