Skip to content

Instantly share code, notes, and snippets.

@DmitrySoshnikov
Last active March 30, 2017 05:39
Show Gist options
  • Save DmitrySoshnikov/2502a262b15f1251ec11ffb3d521dfba to your computer and use it in GitHub Desktop.
Save DmitrySoshnikov/2502a262b15f1251ec11ffb3d521dfba to your computer and use it in GitHub Desktop.
regexp-tree-generator
const regexpTree = require('regexp-tree');
const re = regexpTree.generate({
type: 'RegExp',
body: {
type: 'Char',
value: 'a',
kind: 'simple',
},
flags: 'gi',
});
console.log(re); // '/a/gi'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment