@jiminp/tooltool
    Preparing search index...

    Function escapeRegExp

    • Escapes special regex characters in a string.

      Parameters

      • s: string

        String to escape.

      Returns string

      Escaped string safe for RegExp constructor.

      Use native RegExp.escape() when available.

      new RegExp(escapeRegExp('example.com')).test('example.com');   // true
      new RegExp(escapeRegExp('example.com')).test('exampleXcom'); // false