Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
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. */
28
function
escapeRegExp(str: string): string {
29
return
str.replace(/([.*+?^=!:${}()|[\]\/\\])/g,
'\\$1'
);
30
}
Callers
1
migrateFile
Function · 0.70
Calls
1
replace
Method · 0.45
Tested by
no test coverage detected