node/tools/eslint/node_modules/escape-string-regexp
Rich Trott e8a7003e94 tools: update ESLint, fix unused vars bug
Update ESLint to 3.0.0. This includes an enhancement to `no-unused-vars`
such that it finds a few instances in our code base that it did not find
previously (fixed in previous commits readying this for landing).

PR-URL: https://github.com/nodejs/node/pull/7601
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
2016-07-11 13:47:20 -07: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, fix unused vars bug 2016-07-11 13:47:20 -07: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