regexp-coder
    Preparing search index...

    Class RegExpCoder

    Regular Expression Coder

    Index
    • get source(): string

      Get the source of the current state

      Returns string

    • (?<name>x), (x) Begin a group

      Parameters

      • Optionalname: string

        the group name

      Returns this

    • Clear the content

      Parameters

      • keepDefinitions: boolean = false

        if keep the definitions

      Returns this

    • xy
      Define a variable

      Parameters

      • name: string

        the variable name

      • ...exp: RegExpParam[]

        the variable expression

      Returns this

    • (xy)
      Define a variable for group operation

      Parameters

      • name: string

        the variable name

      • ...exp: RegExpParam[]

        the variable expression

      Returns this

    • [^xy]
      Define a variable for negated set

      Parameters

      • name: string

        the variable name

      • ...exp: RegExpParam[]

        the variable expression

      Returns this

    • x|y
      Define a variable for or operation

      Parameters

      • name: string

        the variable name

      • ...exp: RegExpParam[]

        the variable expression

      Returns this

    • [xy]
      Define a variable for set

      Parameters

      • name: string

        the variable name

      • ...exp: RegExpParam[]

        the variable expression

      Returns this

    • Stash the current expression as a variable.

      Parameters

      • name: string

        the variable name

      Returns this

    • Get the build result

      Parameters

      • Optionalflags: string

        flags

      Returns RegExp

    • Encode a raw string to a regular expression string. Following special characters will be encoded: ^\.()[]?+*|$

      For set case, encoded characters: ^\-] Rules:

      • escape ^ only when it is the first char
      • escape - only when it is not the first char and not the last char
      • escaped \] always

      Parameters

      • raw: string

        the raw string

      • forSet: boolean = false

        if for set [] operation

      Returns string