export const escapeRegExp = (text: string) => text.replace(/[-[\]{}()*+?.,\\^$|]/g, "\\$&"); export const createSearchRegExp = (searchTerm: string): RegExp => new RegExp(`(?:${escapeRegExp(searchTerm)})(?![^<>]*>)`, "gi");