MCPcopy
hub / github.com/angular/angular / escapeRegExp

Function escapeRegExp

packages/localize/tools/src/migrate/migrate.ts:28–30  ·  view source on GitHub ↗

Escapes special regex characters in a string.

(str: string)

Source from the content-addressed store, hash-verified

26
27/** Escapes special regex characters in a string. */
28function escapeRegExp(str: string): string {
29 return str.replace(/([.*+?^=!:${}()|[\]\/\\])/g, '\\$1');
30}

Callers 1

migrateFileFunction · 0.70

Calls 1

replaceMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…