regexp-expression-tree

1.0.0-alpha.1 • Public • Published

RegExpTree

Travis npm package codecov

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

Dependencies (0)

    Dev Dependencies (3)

    Package Sidebar

    Install

    npm i regexp-expression-tree

    Weekly Downloads

    1

    Version

    1.0.0-alpha.1

    License

    MIT

    Unpacked Size

    32.5 kB

    Total Files

    9

    Last publish

    Collaborators

    • menthays