Skip to content

Latest commit

 

History

History
23 lines (14 loc) · 340 Bytes

readme.md

File metadata and controls

23 lines (14 loc) · 340 Bytes

String Escape Regex

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

Install

npm install string-escape-regex

Usage

import escape from 'string-escape-regex';

// Let's escape a string to be used in a regex

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

License

MIT © Fabio Spampinato