Skip to content
This repository has been archived by the owner on Oct 15, 2022. It is now read-only.

tenthousandcoffees/escape-string-regexp

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Escape RegExp special characters

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%