• Matches a string with a regular expression, and returns an array containing the results of that search.

    Parameters

    • regexp: string | RegExp

      A variable name or string literal containing the regular expression pattern and flags.

    Returns null | RegExpMatchArray

  • Matches a string or an object that supports being matched against, and returns an array containing the results of that search, or null if no matches are found.

    Parameters

    • matcher: {
          [match](string: string): null | RegExpMatchArray;
      }

      An object that supports being matched against.

      • [match]:function
        • Parameters

          • string: string

          Returns null | RegExpMatchArray

    Returns null | RegExpMatchArray