regexp-expression-tree
v1.0.0-alpha.1
Published
Describe RegExpTree here
Downloads
3
Readme
RegExpTree
Use Expression Tree
to represent regexp with logical operation (AND/OR).
Usage
// construct tree from postfix notation
const regExprTree = convertRPN2Tree("/^a/g /b$/g AND /c/ OR")
// visit tree in postorder
postVisit(regExprTree) // '/^a/g /b$/g AND /c/ OR'
// visit tree in order
visit(regExprTree) // '/^a/g AND /b$/g OR /c/'
// evaluate tree
evaluate(regExprTree, 'addcddb') // true