escape-string-regexp:Escape RegExp特殊字符

时间:2021-04-29 07:34:51
【文件属性】:
文件名称:escape-string-regexp:Escape RegExp特殊字符
文件大小:6KB
文件格式:ZIP
更新时间:2021-04-29 07:34:51
JavaScript 转义字符串正则表达式 Escape RegExp特殊字符 安装 $ npm install escape-string-regexp 用法 import escapeStringRegexp from 'escape-string-regexp' ; const escapedString = escapeStringRegexp ( 'How much $ for a :unicorn:?' ) ; //=> 'How much \\$ for a :unicorn:\\?' new RegExp ( escapedString ) ; 您还可以使用它来转义插入正则表达式中间(例如,字符类)的字符串。 Tidelift帮助维护人员实现开源的可持续性,同时又为公司有关其依赖项的安全性,维护和许可的保证。
【文件预览】:
escape-string-regexp-main
----index.test-d.ts(144B)
----.gitattributes(19B)
----.github()
--------funding.yml(126B)
--------security.md(179B)
--------workflows()
----test.js(484B)
----license(1KB)
----index.d.ts(437B)
----.npmrc(19B)
----.editorconfig(175B)
----.gitignore(23B)
----index.js(469B)
----readme.md(904B)
----package.json(732B)

网友评论