_.escapeRegExp([string=''])
转义
RegExp
中特殊的字符 "^", "$", "\", ".", "*", " ", "?", "(", ")", "[", "]", "{", "}", 以及 "|"。
_.escapeRegExp('[lodash](https://lodash.com/)');
// => '\[lodash\]\(https://lodash\.com/\)'
更多专业前端知识,请上 【猿2048】www.mk2048.com