Array
Collection
Date
Function
Lang
Math
Object
Seq
String
Util
Properties
Methods
“String” Methods
_.escapeRegExp([string=''])
Escapes the RegExp
special characters "^", "$", "", ".", "*", "+", "?", "(", ")", "[", "]", "{", "}", and "|" in string
.
引入版本
3.0.0
参数
[string='']
(string)
: The string to escape.
返回值
(string)
: Returns the escaped string.
示例
_.escapeRegExp('[lodash](https://lodash.com/)');// => '\[lodash\]\(https://lodash\.com/\)'