Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on Jun 8, 2024 via pnpm

escape-string-regexp 4.0.0

Escape RegExp special characters
Package summary
Share
0
issues
1
license
1
MIT
Package created
24 Jun 2014
Version published
23 Apr 2020
Maintainers
1
Total deps
1
Direct deps
0
License
MIT

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
1 Packages, Including:
escape-string-regexp@4.0.0
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

0
All Dependencies CSV
β“˜ This is a list of escape-string-regexp 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities

Visualizations

Frequently Asked Questions

What does escape-string-regexp do?

Escape-string-regexp is a highly useful npm package made for JavaScript developers. It works by escaping RegExp (Regular Expression) special characters within a string. This can be incredibly helpful when you want to create a new RegExp from a variable and want to prevent mistaken identification of special characters. In simpler terms, this package takes a string and returns a new string where all the special characters have been properly escaped.

How do you use escape-string-regexp?

To use escape-string-regexp, first you need to install it via npm. You can add it to your JavaScript project by running the command:

$ npm install escape-string-regexp

Once installed, you can utilize it in your code. Here's a simple usage example:

import escapeStringRegexp from 'escape-string-regexp';

const escapedString = escapeStringRegexp('How much $ for a πŸ¦„?');
console.log(escapedString);
// Output: 'How much \\$ for a πŸ¦„\\?'

This example takes the string 'How much $ for a πŸ¦„?' and escapes the dollar sign, which is a special RegExp character. The resulting string can then be safely used to create a new RegExp.

Where are the escape-string-regexp docs?

The main documentation for escape-string-regexp is the contents of its README file on the GitHub repository, which can be found at https://github.com/sindresorhus/escape-string-regexp. This README provides the fundamental details of what the package does and how to use it.