mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-02 16:17:50 +00:00
Bump to v3.6.0.
This commit is contained in:
@@ -1,16 +1,16 @@
|
||||
import baseToString from '../internal/baseToString';
|
||||
|
||||
/**
|
||||
* Used to match `RegExp` special characters.
|
||||
* See this [article on `RegExp` characters](http://www.regular-expressions.info/characters.html#special)
|
||||
* for more details.
|
||||
* Used to match `RegExp` [special characters](http://www.regular-expressions.info/characters.html#special).
|
||||
* In addition to special characters the forward slash is escaped to allow for
|
||||
* easier `eval` use and `Function` compilation.
|
||||
*/
|
||||
var reRegExpChars = /[.*+?^${}()|[\]\/\\]/g,
|
||||
reHasRegExpChars = RegExp(reRegExpChars.source);
|
||||
|
||||
/**
|
||||
* Escapes the `RegExp` special characters "\", "^", "$", ".", "|", "?", "*",
|
||||
* "+", "(", ")", "[", "]", "{" and "}" in `string`.
|
||||
* Escapes the `RegExp` special characters "\", "/", "^", "$", ".", "|", "?",
|
||||
* "*", "+", "(", ")", "[", "]", "{" and "}" in `string`.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
@@ -20,7 +20,7 @@ var reRegExpChars = /[.*+?^${}()|[\]\/\\]/g,
|
||||
* @example
|
||||
*
|
||||
* _.escapeRegExp('[lodash](https://lodash.com/)');
|
||||
* // => '\[lodash\]\(https://lodash\.com/\)'
|
||||
* // => '\[lodash\]\(https:\/\/lodash\.com\/\)'
|
||||
*/
|
||||
function escapeRegExp(string) {
|
||||
string = baseToString(string);
|
||||
|
||||
Reference in New Issue
Block a user