Options
All
  • Public
  • Public/Protected
  • All
Menu

Regular Expression Specification

  • Provide basic elements of Javascript/Type Regular Expression
see

Regular Expressions

Hierarchy

  • RegExpSpec

Index

Constructors

constructor

Accessors

Static alphanumeric

  • get alphanumeric(): string
  • \w, Matches any alphanumeric character including the underscore.

    see

    word

    Returns string

Static any

  • get any(): string
  • ., Matches any single character except the newline character, by default.

    see

    dot

    Returns string

Static asterisk

  • get asterisk(): string
  • *, Matches the preceding expression 0 or more times. Equivalent to {0,}.

    see

    asterisk

    Returns string

Static backslash

  • get backslash(): string

Static backspace

  • get backspace(): string

Static begin

  • get begin(): string
  • ^, Matches beginning of input. If the multiline flag is set to true, also matches immediately after a line break character.

    see:

    Caret

    Returns string

Static carriageReturn

  • get carriageReturn(): string
  • \r, Matches a carriage return (U+000D).

    see

    Returns string

Static caseInsensitiveSearchFlag

  • get caseInsensitiveSearchFlag(): string

Static digit

  • get digit(): string

Static dot

  • get dot(): string
  • ., Matches any single character except the newline character, by default.

    see

    dot

    Returns string

Static dotIsNewLineFlag

  • get dotIsNewLineFlag(): string
  • s, Allows . to match newline characters.

    Returns string

Static end

  • get end(): string
  • $, Matches end of input. If the multiline flag is set to true, also matches immediately before a line break character.

    see

    dollar

    Returns string

Static formfeed

  • get formfeed(): string

Static globalSearchFlag

  • get globalSearchFlag(): string

Static linefeed

  • get linefeed(): string

Static more

  • get more(): string
  • *, Matches the preceding expression 0 or more times. Equivalent to {0,}.

    see

    asterisk

    Returns string

Static multipleLineSearchFlag

  • get multipleLineSearchFlag(): string

Static nonDigit

  • get nonDigit(): string

Static nonWhitespace

  • get nonWhitespace(): string

Static nonWord

  • get nonWord(): string

Static nonWordBoundary

  • get nonWordBoundary(): string

Static null

  • get null(): string

Static oneOrMore

  • get oneOrMore(): string
  • +, Matches the preceding expression 1 or more times. Equivalent to {1,}.

    see

    plus

    Returns string

Static plus

  • get plus(): string
  • +, Matches the preceding expression 1 or more times. Equivalent to {1,}.

    see

    plus

    Returns string

Static questionmark

  • get questionmark(): string

Static strickySearchFlag

  • get strickySearchFlag(): string
  • y, Perform a "sticky" search that matches starting at the current position in the target string.

    see

    sticky

    Returns string

Static tab

  • get tab(): string

Static unicodeFlag

  • get unicodeFlag(): string
  • u, "unicode"; treat a pattern as a sequence of unicode code points.

    Returns string

Static verticalTab

  • get verticalTab(): string

Static whitespace

  • get whitespace(): string
  • \s, Matches a white space character, including space, tab, form feed, line feed.

    see

    white space

    Returns string

Static wordBoundary

  • get wordBoundary(): string

Static zeroOrOne

  • get zeroOrOne(): string

Methods

Static backreference

  • backreference(n: number): string
  • \n, Where n is a positive integer, a back reference to the last substring matching the n parenthetical in the regular expression (counting left parentheses).

    see

    backreference

    Parameters

    • n: number

    Returns string

Static capturingParentheses

  • capturingParentheses(x: string | RegExp, name?: string): string
  • (x), Matches x and remembers the match. The parentheses are called capturing parentheses. (?<name>:x), Named capturing group: Matches x and stores it on the groups property of the returned matches under the name specified by .

    see

    capturing parentheses

    see

    Groups and Ranges

    Parameters

    • x: string | RegExp

      expression

    • Optional name: string

      name

    Returns string

Static characterSet

  • characterSet(...chars: string[]): string

Static controlCharacter

  • controlCharacter(X: string): string
  • \cX Matches a control character in a string.

    see

    control

    Parameters

    • X: string

      a character ranging from A to Z.

    Returns string

Static hex

  • hex(hh: string): string
  • \xhh, Matches the character with the code hh.

    see

    hex escape

    Parameters

    • hh: string

      two hexadecimal digits

    Returns string

Static lookahead

  • lookahead(x: string | RegExp, followedBy: string | RegExp): string
  • x(?=y), Matches x only if x is followed by y. This is called a lookahead.

    see

    lookahead

    Parameters

    • x: string | RegExp

      expression

    • followedBy: string | RegExp

      the followed by expression

    Returns string

Static lookbehind

  • lookbehind(x: string | RegExp, precededBy: string | RegExp): string
  • (?<=y)x, Matches x only if x is preceded by y. This is called a lookbehind.

    see

    lookbehind

    Parameters

    • x: string | RegExp

      expression

    • precededBy: string | RegExp

      the preceded by expression

    Returns string

Static negatedCharacterSet

  • negatedCharacterSet(...chars: string[]): string

Static negatedLookahead

  • negatedLookahead(x: string | RegExp, notFollowedBy: string | RegExp): string
  • x(?!y) Matches x only if x is not followed by y. This is called a negated lookahead.

    see

    negated look ahead

    Parameters

    • x: string | RegExp

      expression

    • notFollowedBy: string | RegExp

      the not followed by expression

    Returns string

Static negatedLookbehind

  • negatedLookbehind(x: string | RegExp, notPrecededBy: string | RegExp): string
  • (?<!y)x, Matches x only if x is not preceded by y. This is called a negated lookbehind.

    see

    negative lookbehind

    Parameters

    • x: string | RegExp

      expression

    • notPrecededBy: string | RegExp

      the not preceded by expression

    Returns string

Static nonCapturingParentheses

  • nonCapturingParentheses(x: string | RegExp): string
  • (?:x), Matches x but does not remember the match. The parentheses are called non-capturing parentheses.

    see

    non capturing parentheses

    Parameters

    • x: string | RegExp

      expression

    Returns string

Static occurrence

  • occurrence(n: number): string
  • {n}, Matches exactly n occurrences of the preceding expression. N must be a positive integer.

    see

    quantifier

    Parameters

    • n: number

      times of occurrences

    Returns string

Static occurrenceOrMore

  • occurrenceOrMore(n: number, m?: number): string
  • (n, }, {n, m}, Matches at least n occurrences of the preceding expression. N must be a positive integer. Where n and m are positive integers and n <= m. Matches at least n and at most m occurrences of the preceding expression. When m is omitted, it's treated as .

    see

    quantifier

    see

    quantifier-range

    Parameters

    • n: number

      at least occurrences

    • Optional m: number

      (optional) at most occurrences

    Returns string

Static or

  • or(...items: string[] | RegExp[]): string
  • x|y, Matches 'x', or 'y' (if there is no match for 'x').

    see

    or

    Parameters

    • Rest ...items: string[] | RegExp[]

      expression

    Returns string

Static unicode

  • unicode(hhhh: string): string
  • \uhhhh Matches the character with the code hhhh.

    see

    unicode-escape

    Parameters

    • hhhh: string

      four hexadecimal digits

    Returns string

Static unicodeU

  • unicodeU(hhhh: string): string
  • \u{hhhh} (only when u flag is set) Matches the character with the Unicode value hhhh (hexadecimal digits).

    see

    unicode-escape-es6

    Parameters

    • hhhh: string

      four hexadecimal digits

    Returns string

Generated using TypeDoc