Skip to content
Escape RegExp special characters
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore
.travis.yml
LICENSE
README.md
mod.ts
test.ts

README.md

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

escape-string-regexp

Build Status

Escape RegExp special characters

Usage

import { escapeStringRegexp } from 'https://raw.githubusercontent.com/Sab94/escape-string-regexp/master/mod.ts'

const  a = escapeStringRegexp('\\ ^ $ * + ? . ( ) | { } [ ]');
console.log(a)

//result: '\\\\ \\^ \\$ \\* \\+ \\? \\. \\( \\) \\| \\{ \\} \\[ \\]'

License

MIT

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.