mirror of
https://github.com/nodejs/node.git
synced 2025-05-07 19:56:48 +00:00
![]() PR-URL: https://github.com/nodejs/node/pull/16199 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> |
||
---|---|---|
.. | ||
index.js | ||
license | ||
package.json | ||
readme.md |
escape-string-regexp 
Escape RegExp special characters
Install
$ npm install --save escape-string-regexp
Usage
const escapeStringRegexp = require('escape-string-regexp');
const escapedString = escapeStringRegexp('how much $ for a unicorn?');
//=> 'how much \$ for a unicorn\?'
new RegExp(escapedString);
License
MIT © Sindre Sorhus