1 export const escapeRegex = (string: string) => {
2 return string.replace(/[-/\\^$*+?.()|[\]{}]/g, '\\$&');
5 export interface MatchChunk {
10 export const getMatches = (regex: RegExp, b: string): MatchChunk[] => {
11 return [...b.matchAll(regex)].map((match) => {
12 const { index = 0 } = match;
15 end: index + match[0].length,