Function parseToRegexOrLiteralSearchCached

A wrapped version of parseToRegexOrLiteralSearch that caches RegExp's based on inputs of RegExp string + behavior + default flags

  • Parameters

    Returns ((val: string, options??: string | LiteralSearchOptions) => RegExp)

      • (val, options?): RegExp
      • Tries to parse a string as a regular expression. If this fails it tries to convert the string into a Regular Expression with a literal search for the string value.

        Parameters

        • val: string

          The string to parse

        • Optionaloptions: string | LiteralSearchOptions = {}

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

        Returns RegExp