MCPcopy Create free account
hub / github.com/angular/angular / escapeRegExp

Function escapeRegExp

packages/compiler/src/util.ts:40–42  ·  view source on GitHub ↗
(s: string)

Source from the content-addressed store, hash-verified

38
39// Escape characters that have a special meaning in Regular Expressions
40export function escapeRegExp(s: string): string {
41 return s.replace(/([.*+?^=!:${}()|[\]\/\\])/g, '\\$1');
42}
43
44export type Byte = number;
45

Callers 6

util_spec.tsFile · 0.90
xliff2_spec.tsFile · 0.90
xliff_spec.tsFile · 0.90
xtb_spec.tsFile · 0.90
declareTestsFunction · 0.90

Calls 1

replaceMethod · 0.45

Tested by

no test coverage detected