Files
explore/lib/escapeRegExp.ts
2022-12-28 12:36:41 +03:00

4 lines
150 B
TypeScript

export default function escapeRegExp(string: string) {
return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); // $& means the whole matched string
}