Function regexEscapeString

  • Escapes special characters in a string to be used in a regular expression.

    Parameters

    • str: string

      The input string to escape.

    Returns string

    The escaped string.

    Example

    const input = 'Hello, world!';
    regexEscapeString(input);;
    //=> 'Hello, world!'

Generated using TypeDoc