escape-string-regexp

WebJar for escape-string-regexp

License

License

MIT
GroupId

GroupId

org.webjars.bowergithub.sindresorhus
ArtifactId

ArtifactId

escape-string-regexp
Last Version

Last Version

2.0.0
Release Date

Release Date

Type

Type

jar
Description

Description

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

Project URL

http://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.bowergithub.sindresorhus/escape-string-regexp/ -->
<dependency>
    <groupId>org.webjars.bowergithub.sindresorhus</groupId>
    <artifactId>escape-string-regexp</artifactId>
    <version>2.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.bowergithub.sindresorhus/escape-string-regexp/
implementation 'org.webjars.bowergithub.sindresorhus:escape-string-regexp:2.0.0'
// https://jarcasting.com/artifacts/org.webjars.bowergithub.sindresorhus/escape-string-regexp/
implementation ("org.webjars.bowergithub.sindresorhus:escape-string-regexp:2.0.0")
'org.webjars.bowergithub.sindresorhus:escape-string-regexp:jar:2.0.0'
<dependency org="org.webjars.bowergithub.sindresorhus" name="escape-string-regexp" rev="2.0.0">
  <artifact name="escape-string-regexp" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.bowergithub.sindresorhus', module='escape-string-regexp', version='2.0.0')
)
libraryDependencies += "org.webjars.bowergithub.sindresorhus" % "escape-string-regexp" % "2.0.0"
[org.webjars.bowergithub.sindresorhus/escape-string-regexp "2.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
2.0.0
1.0.5