MCPcopy Index your code
hub / github.com/simstudioai/sim / buildRegex

Function buildRegex

apps/sim/lib/logs/log-views.ts:197–203  ·  view source on GitHub ↗
(pattern: string)

Source from the content-addressed store, hash-verified

195}
196
197function buildRegex(pattern: string): RegExp {
198 try {
199 return new RegExp(pattern, 'i')
200 } catch {
201 return new RegExp(escapeRegExp(pattern), 'i')
202 }
203}
204
205function snippetAround(text: string, regex: RegExp, maxChars: number): string {
206 const m = regex.exec(text)

Callers 1

grepSpansFunction · 0.85

Calls 1

escapeRegExpFunction · 0.70

Tested by

no test coverage detected