Name |
Date |
Size |
#Lines |
LOC |
||
---|---|---|---|---|---|---|
.. | - | - | ||||
index.js | D | 12-May-2024 | 226 | 12 | 8 | |
license | D | 12-May-2024 | 1.1 KiB | 22 | 17 | |
package.json | D | 12-May-2024 | 2 KiB | 85 | 84 | |
readme.md | D | 12-May-2024 | 552 | 28 | 15 |
readme.md
1# escape-string-regexp [](https://travis-ci.org/sindresorhus/escape-string-regexp) 2 3> Escape RegExp special characters 4 5 6## Install 7 8``` 9$ npm install --save escape-string-regexp 10``` 11 12 13## Usage 14 15```js 16const escapeStringRegexp = require('escape-string-regexp'); 17 18const escapedString = escapeStringRegexp('how much $ for a unicorn?'); 19//=> 'how much \$ for a unicorn\?' 20 21new RegExp(escapedString); 22``` 23 24 25## License 26 27MIT © [Sindre Sorhus](http://sindresorhus.com) 28