Created
April 17, 2017 19:54
-
-
Save DmitrySoshnikov/91bddb1aea8fd8d62253a0b685008c93 to your computer and use it in GitHub Desktop.
regexp-tree-optimizer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const regexpTree = require('regexp-tree'); | |
const originalRe = /[a-zA-Z_0-9][A-Z_\da-z]*\e{1,}/; | |
const optimizedRe = regexpTree | |
.optimize(originalRe) | |
.toRegExp(); | |
console.log(optimizedRe); // /\w+e+/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment