MCPcopy Create free account
hub / github.com/circircir-circle/human_exist_device / escapeForRegexp

Method escapeForRegexp

mini_program/common/Tools.js:270–272  ·  view source on GitHub ↗

* 字符串转义 * @param {String} str * @return {String}

(str)

Source from the content-addressed store, hash-verified

268 * @return {String}
269 */
270 escapeForRegexp(str) {
271 return str.replace(/([-()\[\]{}+?*.$\^|,:#<!\\])/g, '\\$1').replace(/\x08/g, '\\x08')
272 }
273
274 /**
275 * 字符串转对象

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected