1.0.2 • Published 2 years ago

regexp-escaper v1.0.2

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

To install the package, run the following command

npm install --save regexp-escaper

This package helps to escape regular expressions' special characters in the text.

[ ] . * + ? ^ $ { } ( ) | \

Usage

import { regexpEscaper } from 'regexp-escaper'; // ES6 Module
const { regexpEscaper } = require('regexp-escaper'); // CommonJS

const text = "S.o\m[e(t]h)ing"
console.log(regexpEscaper(text)); // S\.om\[e\(t\]h\)ing