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