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

Function escapeForRegexp

test/angular/1.6/angular.js:892–897  ·  view source on GitHub ↗
(s)

Source from the content-addressed store, hash-verified

890// http://docs.closure-library.googlecode.com/git/local_closure_goog_string_string.js.source.html#line1021
891// Prereq: s is a string.
892var escapeForRegexp = function(s) {
893 return s
894 .replace(/([-()[\]{}+?*.$^|,:#<!\\])/g, '\\$1')
895 // eslint-disable-next-line no-control-regex
896 .replace(/\x08/g, '\\x08');
897};
898
899
900/**

Callers 2

adjustMatcherFunction · 0.70
$$TestabilityProviderFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected