Tries to parse a string as a regular expression

  • Parameters

    • val: string

      The string to parse

    • OptionaldefaultFlags: string

      Flags to set on the parsed Regular Expression if it does not have its own

    Returns RegExp