_.escapeRegExp([string=''])
转义 RegExp
字符串中特殊的字符 "^", "$", "", ".", "*", "+", "?", "(", ")", "[", "]", ", ", 和 "|" in .
添加版本
3.0.0
参数
[string='']
(string): 要转义的字符串。
返回
(string): 返回转义后的字符串。
例子
_.escapeRegExp('[lodash](https://lodash.com/)');
// => '\[lodash\]\(https://lodash\.com/\)'