work.suroh.tk/node_modules/escape-string-regexp
suroh 410082595a init 11ty commit 2019-12-02 13:22:45 +01:00
..
index.js init 11ty commit 2019-12-02 13:22:45 +01:00
license init 11ty commit 2019-12-02 13:22:45 +01:00
package.json init 11ty commit 2019-12-02 13:22:45 +01:00
readme.md init 11ty commit 2019-12-02 13:22:45 +01:00

readme.md

escape-string-regexp Build Status

Escape RegExp special characters

Install

$ npm install --save escape-string-regexp

Usage

const escapeStringRegexp = require('escape-string-regexp');

const escapedString = escapeStringRegexp('how much $ for a unicorn?');
//=> 'how much \$ for a unicorn\?'

new RegExp(escapedString);

License

MIT © Sindre Sorhus