escape-string-regexp

WebJar for escape-string-regexp

License

License

MIT
GroupId

GroupId

org.webjars.bower
ArtifactId

ArtifactId

escape-string-regexp
Last Version

Last Version

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

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

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
1.0.5