MCPcopy Create free account
hub / github.com/cafebazaar/blacksmith / escapeForRegexp

Function escapeForRegexp

web/static/bower_components/angular/angular.js:755–758  ·  view source on GitHub ↗
(s)

Source from the content-addressed store, hash-verified

753// http://docs.closure-library.googlecode.com/git/local_closure_goog_string_string.js.source.html#line1021
754// Prereq: s is a string.
755var escapeForRegexp = function(s) {
756 return s.replace(/([-()\[\]{}+?*.$\^|,:#<!\\])/g, '\\$1').
757 replace(/\x08/g, '\\x08');
758};
759
760
761/**

Callers 2

adjustMatcherFunction · 0.85
$$TestabilityProviderFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected