RedEnvelope/node_modules/escape-string-regexp
2026-03-01 23:22:26 +08:00
..
index.js build: 构建脚本更新 2026-03-01 23:22:26 +08:00
license build: 构建脚本更新 2026-03-01 23:22:26 +08:00
package.json build: 构建脚本更新 2026-03-01 23:22:26 +08:00
readme.md build: 构建脚本更新 2026-03-01 23:22:26 +08:00

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