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

Function escapeForRegexp

lib/test/angular/1.6.7/angular.js:882–887  ·  view source on GitHub ↗
(s)

Source from the content-addressed store, hash-verified

880// http://docs.closure-library.googlecode.com/git/local_closure_goog_string_string.js.source.html#line1021
881// Prereq: s is a string.
882var escapeForRegexp = function(s) {
883 return s
884 .replace(/([-()[\]{}+?*.$^|,:#<!\\])/g, '\\$1')
885 // eslint-disable-next-line no-control-regex
886 .replace(/\x08/g, '\\x08');
887};
888
889
890/**

Callers 2

adjustMatcherFunction · 0.70
$$TestabilityProviderFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected