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

Function escapeForRegexp

lib/test/angular/1.7.0/angular.js:850–855  ·  view source on GitHub ↗
(s)

Source from the content-addressed store, hash-verified

848// http://docs.closure-library.googlecode.com/git/local_closure_goog_string_string.js.source.html#line1021
849// Prereq: s is a string.
850var escapeForRegexp = function(s) {
851 return s
852 .replace(/([-()[\]{}+?*.$^|,:#<!\\])/g, '\\$1')
853 // eslint-disable-next-line no-control-regex
854 .replace(/\x08/g, '\\x08');
855};
856
857
858/**

Callers 2

adjustMatcherFunction · 0.70
$$TestabilityProviderFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected