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