* Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+", * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`. * * @static * @memberOf _ * @since 3.0.0 * @category String * @param {string} [string=''] The string to escape. * @returns {string} Returns the escaped st
(string)
| 54273 | * // => '\[lodash\]\(https://lodash\.com/\)' |
| 54274 | */ |
| 54275 | function escapeRegExp(string) { |
| 54276 | string = toString(string); |
| 54277 | return string && reHasRegExpChar.test(string) ? string.replace(reRegExpChar, '\\$&') : string; |
| 54278 | } |
| 54279 | |
| 54280 | module.exports = escapeRegExp; |
| 54281 |
nothing calls this directly
no test coverage detected