Unleash awesomeness. Private packages, team management tools, and powerful integrations. Get started with npm Orgs »

escape-string-regexp

1.0.5 • Public • Published

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

install

npm i escape-string-regexp

Downloadsweekly downloads

8,705,042

version

1.0.5

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability