# escape-string-regexp [](https://travis-ci.org/sindresorhus/escape-string-regexp)
> Escape RegExp special characters
## Install
```
$ npm install escape-string-regexp
```
## Usage
```js
const escapeStringRegexp = require('escape-string-regexp');
const escapedString = escapeStringRegexp('How much $ for a ๐ฆ?');
//=> 'How much \\$ for a ๐ฆ\\?'
new RegExp(escapedString);
```
You can also use this to escape a string that is inserted into the middle of a regex, for example, into a character class.
## License
MIT ยฉ [Sindre Sorhus](https://sindresorhus.com)
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/EricA1019/CTS_MCP'
If you have feedback or need assistance with the MCP directory API, please join our Discord server