MCPcopy Create free account
hub / github.com/angular-ui/ui-router / escapeForRegexp

Function escapeForRegexp

test/angular/1.5/angular.js:767–772  ·  view source on GitHub ↗
(s)

Source from the content-addressed store, hash-verified

765// http://docs.closure-library.googlecode.com/git/local_closure_goog_string_string.js.source.html#line1021
766// Prereq: s is a string.
767var escapeForRegexp = function(s) {
768 return s
769 .replace(/([-()[\]{}+?*.$^|,:#<!\\])/g, '\\$1')
770 // eslint-disable-next-line no-control-regex
771 .replace(/\x08/g, '\\x08');
772};
773
774
775/**

Callers 2

adjustMatcherFunction · 0.70
$$TestabilityProviderFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected