Skip to content

Instantly share code, notes, and snippets.

@DmitrySoshnikov
Created April 17, 2017 19:54
Show Gist options
  • Save DmitrySoshnikov/91bddb1aea8fd8d62253a0b685008c93 to your computer and use it in GitHub Desktop.
Save DmitrySoshnikov/91bddb1aea8fd8d62253a0b685008c93 to your computer and use it in GitHub Desktop.
regexp-tree-optimizer
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