mirror of
https://github.com/hanzonet/explore.git
synced 2026-10-30 18:16:57 +00:00
4 lines
150 B
TypeScript
4 lines
150 B
TypeScript
export default function escapeRegExp(string: string) {
|
|
return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); // $& means the whole matched string
|
|
}
|