MCPcopy Create free account
hub / github.com/ampproject/amphtml / escapeRegExp

Function escapeRegExp

build-system/server/app.js:1121–1123  ·  view source on GitHub ↗

* @param {string} string * @return {string}

(string)

Source from the content-addressed store, hash-verified

1119 * @return {string}
1120 */
1121function escapeRegExp(string) {
1122 return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
1123}
1124
1125/**
1126 * @param {string} tagName

Callers 1

elementExtractorFunction · 0.70

Calls 1

replaceMethod · 0.45

Tested by

no test coverage detected