node/tools/eslint/node_modules/escape-string-regexp
silverwind 2f6ff1bb64
tools: update ESLint to 2.7.0
PR-URL: https://github.com/nodejs/node/pull/6132
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: thefourtheye <thechargingvolcano@gmail.com>
2016-04-10 11:46:08 +02:00
..
index.js tools: update eslint to v1.10.3 2016-01-13 23:15:39 +01:00
license tools: replace closure-linter with eslint 2015-05-09 12:09:52 +09:00
package.json tools: update ESLint to 2.7.0 2016-04-10 11:46:08 +02:00
readme.md tools: update eslint to v1.10.3 2016-01-13 23:15:39 +01:00

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