MCPcopy Index your code
hub / github.com/microsoft/SandDance / escapeRegExp

Function escapeRegExp

scripts/readme.js:50–52  ·  view source on GitHub ↗
(str)

Source from the content-addressed store, hash-verified

48
49//https://stackoverflow.com/questions/1144783/how-to-replace-all-occurrences-of-a-string-in-javascript
50function escapeRegExp(str) {
51 return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); // $& means the whole matched string
52}
53
54function rewriteURLs(html) {
55 for (var key in map) {

Callers 1

rewriteURLsFunction · 0.85

Calls 1

replaceMethod · 0.80

Tested by

no test coverage detected