Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • RegExp

Index

Methods

[Symbol.match]

  • [Symbol.match](string: string): RegExpMatchArray | null
  • Matches a string with this regular expression, and returns an array containing the results of that search.

    Parameters

    • string: string

      A string to search within.

    Returns RegExpMatchArray | null

[Symbol.replace]

  • [Symbol.replace](string: string, replaceValue: string): string
  • [Symbol.replace](string: string, replacer: function): string
  • Replaces text in a string, using this regular expression.

    Parameters

    • string: string

      A String object or string literal whose contents matching against this regular expression will be replaced

    • replaceValue: string

      A String object or string literal containing the text to replace for every successful match of this regular expression.

    Returns string

  • Replaces text in a string, using this regular expression.

    Parameters

    • string: string

      A String object or string literal whose contents matching against this regular expression will be replaced

    • replacer: function

      A function that returns the replacement text.

        • (substring: string, ...args: any[]): string
        • Parameters

          • substring: string
          • Rest ...args: any[]

          Returns string

    Returns string

[Symbol.search]

  • [Symbol.search](string: string): number
  • Finds the position beginning first substring match in a regular expression search using this regular expression.

    Parameters

    • string: string

      The string to search within.

    Returns number

[Symbol.split]

  • [Symbol.split](string: string, limit?: number): string[]
  • Returns an array of substrings that were delimited by strings in the original input that match against this regular expression.

    If the regular expression contains capturing parentheses, then each time this regular expression matches, the results (including any undefined results) of the capturing parentheses are spliced.

    Parameters

    • string: string

      string value to split

    • Optional limit: number

      if not undefined, the output array is truncated so that it contains no more than 'limit' elements.

    Returns string[]

Generated using TypeDoc