MCPcopy
hub / github.com/darkreader/darkreader / getMatches

Function getMatches

src/utils/text.ts:56–63  ·  view source on GitHub ↗
(regex: RegExp, input: string, group = 0)

Source from the content-addressed store, hash-verified

54}
55
56export function getMatches(regex: RegExp, input: string, group = 0): string[] {
57 const matches: string[] = [];
58 let m: RegExpMatchArray | null;
59 while ((m = regex.exec(input))) {
60 matches.push(m[group]);
61 }
62 return matches;
63}
64
65export function getMatchesWithOffsets(regex: RegExp, input: string, group = 0): Array<{text: string; offset: number}> {
66 const matches: Array<{text: string; offset: number}> = [];

Callers 4

getBgImageModifierFunction · 0.90
getGradientModifierFunction · 0.90
replaceBlobsFunction · 0.90

Calls 1

execMethod · 0.80

Tested by

no test coverage detected