escape-string-regexp

WebJar for escape-string-regexp

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

escape-string-regexp
Last Version

Last Version

4.0.0
Release Date

Release Date

Type

Type

jar
Description

Description

escape-string-regexp
WebJar for escape-string-regexp
Project URL

Project URL

https://www.webjars.org
Source Code Management

Source Code Management

https://github.com/sindresorhus/escape-string-regexp

Download escape-string-regexp

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/escape-string-regexp/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>escape-string-regexp</artifactId>
    <version>4.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/escape-string-regexp/
implementation 'org.webjars.npm:escape-string-regexp:4.0.0'
// https://jarcasting.com/artifacts/org.webjars.npm/escape-string-regexp/
implementation ("org.webjars.npm:escape-string-regexp:4.0.0")
'org.webjars.npm:escape-string-regexp:jar:4.0.0'
<dependency org="org.webjars.npm" name="escape-string-regexp" rev="4.0.0">
  <artifact name="escape-string-regexp" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='escape-string-regexp', version='4.0.0')
)
libraryDependencies += "org.webjars.npm" % "escape-string-regexp" % "4.0.0"
[org.webjars.npm/escape-string-regexp "4.0.0"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

escape-string-regexp Build Status

Escape RegExp special characters

Install

$ npm install escape-string-regexp

Usage

const escapeStringRegexp = require('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.

Versions

Version
4.0.0
2.0.0
1.0.5
1.0.4
1.0.3
1.0.2