【文件属性】:
文件名称:regex-combiner:将多个正则表达式合二为一
文件大小:8KB
文件格式:ZIP
更新时间:2021-05-30 07:37:16
JavaScript
正则表达式组合器
将一组正则表达式组合成一个正则表达式。
例子
var regexCombiner = require ( 'regex-combiner' ) ;
var combined = regexCombiner ( [
/ abc $ / ,
/ abcd + e / ,
/ a. * / ,
/ bar / ,
'bad+' // strings are accepted too
] ) ;
/* /(a(bc($|d+e)|.*)|ba(r|d+))/ */
combined . test ( 'abcdddde' ) ; // true
combined . test ( 'bar' ) ; // true
combined . test ( 'baddd' ) ; // true
注意事项
没有旗帜! 组合区分大小写和不区分大小
【文件预览】:
regex-combiner-master
----test.js(2KB)
----HISTORY.md(92B)
----package.json(640B)
----benchmark.js(11KB)
----README.md(793B)
----regex-combiner.js(2KB)