pixsy/node_modules/escape-string-regexp
synth-ruiner 495f1d958e initial 2017-12-22 17:22:08 +00:00
..
index.js initial 2017-12-22 17:22:08 +00:00
license initial 2017-12-22 17:22:08 +00:00
package.json initial 2017-12-22 17:22:08 +00:00
readme.md initial 2017-12-22 17:22:08 +00:00

readme.md

escape-string-regexp Build Status

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