Options
All
  • Public
  • Public/Protected
  • All
Menu

Module escapeRegExp

Index

References

Functions String

References

Renames and re-exports escapeRegExp

String Functions

  • escapeRegExp(string: string): string
  • Escapes the RegExp special characters "^", "$", "", ".", "*", "+", "?", "(", ")", "[", "]", "{", "}", and "|" in string.

    since

    5.12.0

    see

    escape, escapeRegExp, unescape

    example
    escapeRegExp('[lodash](https://lodash.com/)')
    // => '\[lodash\]\(https://lodash\.com/\)'

    Parameters

    • string: string

      The string to escape.

    Returns string

    string Returns the escaped string.