deno.land / x / escape_string_regexp@v0.0.1

LICENSE1 KB
mod.ts230 B
README.md565 B
test.ts401 B
.gitignore5 B
.travis.yml144 B

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

escape_string_regexp

Version Info

Tagged at
3 years ago