regexgen
github.com
一个可以从字符串生成正则表达式的工具,支持通过Trie数据结构优化正则表达式模式。
Visit websitehttps://github.com/devongovett/regexgen使用例:```jsconst {Trie} = require('regexgen');let t = new Trie;t.add('foobar');t.add('foobaz');t.toRegExp(); // => /fooba[rz]/```
github.com
一个可以从字符串生成正则表达式的工具,支持通过Trie数据结构优化正则表达式模式。
Visit websitehttps://github.com/devongovett/regexgen使用例:```jsconst {Trie} = require('regexgen');let t = new Trie;t.add('foobar');t.add('foobaz');t.toRegExp(); // => /fooba[rz]/```