string-escape-regex
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

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

Package Sidebar

Install

npm i string-escape-regex

Weekly Downloads

10,419

Version

1.0.0

License

none

Unpacked Size

3.84 kB

Total Files

9

Last publish

Collaborators

  • fabiospampinato