MCPcopy Index your code
hub / github.com/scriptscat/scriptcat / escapeRegex

Function escapeRegex

src/pkg/utils/utils.ts:470–470  ·  view source on GitHub ↗
(str: string)

Source from the content-addressed store, hash-verified

468
469 // Escape special regex characters except * and ?
470 const escapeRegex = (str: string) => str.replace(/[-[\]{}()+.,\\^$|#\s]/g, "\\$&");
471
472 // Convert glob pattern to regex
473 let pattern = escapeRegex(sub)

Callers 1

stringMatchingFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected