Options
All
  • Public
  • Public/Protected
  • All
Menu

Regular Expression Coder

see

Regular Expressions

Hierarchy

  • RegExpCoder

Index

Constructors

constructor

Accessors

source

  • get source(): string

Methods

beginGroup

clear

define

defineGroup

defineLookahead

defineLookbehind

defineNegatedLookahead

defineNegatedLookbehind

defineNegatedSet

defineOr

defineSet

enableMatchWhole

endGroup

group

join

lookahead

lookbehind

negatedLookahead

negatedLookbehind

negatedSet

or

set

stash

toRegExp

  • toRegExp(flags?: string): RegExp
  • Get the build result

    Parameters

    • Optional flags: string

      flags

    Returns RegExp

Static encodeRegExp

  • encodeRegExp(raw: string, forSet?: boolean): string
  • 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

Static new

Generated using TypeDoc