4
0
Fork 0
mirror of https://github.com/Azure/setup-helm.git synced 2025-11-07 21:16:57 +00:00
setup-helm/node_modules/escape-string-regexp
github-actions[bot] a517f2ff65
Add node modules and new code for release (#57)
Co-authored-by: taakleton <taakleton@users.noreply.github.com>
2022-01-26 17:16:26 -05:00
..
index.d.ts Add node modules and new code for release (#57) 2022-01-26 17:16:26 -05:00
index.js Add node modules and new code for release (#57) 2022-01-26 17:16:26 -05:00
license Add node modules and new code for release (#57) 2022-01-26 17:16:26 -05:00
package.json Add node modules and new code for release (#57) 2022-01-26 17:16:26 -05:00
readme.md Add node modules and new code for release (#57) 2022-01-26 17:16:26 -05:00

escape-string-regexp Build Status

Escape RegExp special characters

Install

$ npm install escape-string-regexp

Usage

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

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

new RegExp(escapedString);

You can also use this to escape a string that is inserted into the middle of a regex, for example, into a character class.

License

MIT © Sindre Sorhus