regexp-escaper
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

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

Package Sidebar

Install

npm i regexp-escaper

Weekly Downloads

2

Version

1.0.2

License

ISC

Unpacked Size

1.26 kB

Total Files

5

Last publish

Collaborators

  • azizbek.mamarasulov