MCPcopy Index your code
hub / github.com/microsoft/vscode-cpptools / escapeStringForRegex

Function escapeStringForRegex

Extension/src/common.ts:1490–1492  ·  view source on GitHub ↗
(str: string)

Source from the content-addressed store, hash-verified

1488}
1489
1490export function escapeStringForRegex(str: string): string {
1491 return str.replace(/([.*+?^=!:${}()|\[\]\/\\])/g, '\\$1');
1492}
1493
1494export function replaceAll(str: string, searchValue: string, replaceValue: string): string {
1495 const pattern: string = escapeStringForRegex(searchValue);

Callers 3

onDataMethod · 0.90
spawnChildProcessImplFunction · 0.85
replaceAllFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected