prc b6c02717e6 Upload complete no-internet building environment. | 1 жил өмнө | |
---|---|---|
.. | ||
index.js | 1 жил өмнө | |
license | 1 жил өмнө | |
package.json | 1 жил өмнө | |
readme.md | 1 жил өмнө |
Escape RegExp special characters
$ npm install --save escape-string-regexp
const escapeStringRegexp = require('escape-string-regexp');
const escapedString = escapeStringRegexp('how much $ for a unicorn?');
//=> 'how much \$ for a unicorn\?'
new RegExp(escapedString);
MIT © Sindre Sorhus