转义RegExp 中特殊的字符 "^", "$", "\", ".", "*", "+", "?", "(", ")", "[", "]", "{", "}", 以及 "|"。
RegExp
_.escapeRegExp(‘[lodash](https://lodash.com/)‘); // => ‘\[lodash\]\(https://lodash\.com/\)‘
lodash escapeRegExp 转义正则特殊字符
原文:https://www.cnblogs.com/mengfangui/p/9210506.html