Big update!Announcing Socket for GitHub 1.0. Learn more
Socket
BlogLoveFAQ
Install
Log in

escape-string-regexp

Package Overview
Dependencies
0
Maintainers
1
Versions
10
Issues
File Explorer

Advanced tools

escape-string-regexp

Escape RegExp special characters

    5.0.0latest

Version published
Maintainers
1
Weekly downloads
84,835,055
increased by0.9%

Weekly downloads

Changelog

Source

Breaking

  • Require Node.js 12 aebb6e8
  • This package is now pure ESM. Please read this.

https://github.com/sindresorhus/escape-string-regexp/compare/v4.0.0...v5.0.0

Readme

Source

escape-string-regexp

Escape RegExp special characters

Install

$ npm install escape-string-regexp

Usage

import escapeStringRegexp from 'escape-string-regexp'; const escapedString = escapeStringRegexp('How much $ for a 🦄?'); //=> 'How much \\$ for a 🦄\\?' new RegExp(escapedString);

You can also use this to escape a string that is inserted into the middle of a regex, for example, into a character class.


Get professional support for this package with a Tidelift subscription
Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies.

Keywords

FAQs

What is escape-string-regexp?

Escape RegExp special characters

Is escape-string-regexp popular?

The npm package escape-string-regexp receives a total of 80,551,538 weekly downloads. As such, escape-string-regexp popularity was classified as popular.

Is escape-string-regexp well maintained?

We found that escape-string-regexp demonstrated a not healthy version release cadence and project activity. It has 1 open source maintainer collaborating on the project.

Last updated on 17 Apr 2021
Socket

Product

Subscribe to our newsletter

Get open source security insights delivered straight into your inbox. Be the first to learn about new features and product updates.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc