escape-string-regexp (1.0.5)
Published 2026-02-24 13:56:06 +00:00 by atheaadmin
Installation
registry=npm install escape-string-regexp@1.0.5"escape-string-regexp": "1.0.5"About this package
escape-string-regexp 
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
Dependencies
Development Dependencies
| ID | Version |
|---|---|
| ava | * |
| xo | * |
Keywords
escape
regex
regexp
re
regular
expression
string
str
special
characters
Details
Assets (1)
Versions (3)
View all
escape-string-regexp-1.0.5.tgz
1.5 KiB