A wrapped version of testMaybeRegex that caches RegExp's based on inputs of + default flags

  • Parameters

    Returns ((test: string, subject: string, options??: string | LiteralSearchOptions) => [boolean, string])

      • (test, subject, options?): [boolean, string]
      • Tries to parse a string as a regular expression, falling back to literal search, and then tests a given value

        Returns a tuple of [matchedExpressionBool,matchedValString]

        Parameters

        • test: string

          The string to use a regular expression

        • subject: string

          The string to test with the regular expression

        • Optionaloptions: string | LiteralSearchOptions = {}

          Options related to how to parse the string value for the literal search

        Returns [boolean, string]