Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "utils/regexp-from-string/docs/types/index.d"

Index

Functions

Functions

Export assignment reFromString

  • reFromString(str: string): RegExp | null
  • Parses a regular expression string and returns a new regular expression.

    Notes

    • Provided strings should be properly escaped.
    • If unable to parse a string as a regular expression, the function returns null.
    throws

    must provide a regular expression string

    Parameters

    • str: string

      regular expression string

    Returns RegExp | null

    regular expression or null

    Example

    var re = reFromString( '/beep/' );
    // returns /beep/