Skip to content

A tiny function for escaping a string to be used as the source in a regex.

License

Notifications You must be signed in to change notification settings

fabiospampinato/string-escape-regex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

String Escape Regex

A tiny function for escaping a string to be used as the source in a regex.

Install

npm install --save string-escape-regex

Usage

import escape from 'string-escape-regex';

escape ( 'foo()' ); // => 'foo\\(\\)'

License

MIT © Fabio Spampinato

About

A tiny function for escaping a string to be used as the source in a regex.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published