@newdash/newdash
Version:
javascript/typescript utility library
19 lines (18 loc) • 534 B
TypeScript
/**
* Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+",
* "?", "(", ")", "[", "]", "{", "}", and "|" in `string`.
*
* @since 5.12.0
* @category String
* @param string The string to escape.
* @returns string Returns the escaped string.
* @see [[escape]], [[escapeRegExp]], [[unescape]]
* @example
*
* ```js
* escapeRegExp('[lodash](https://lodash.com/)')
* // => '\[lodash\]\(https://lodash\.com/\)'
* ```
*/
export declare function escapeRegExp(string: string): string;
export default escapeRegExp;