package
A tiny function for escaping a string to be used as the source in a regex.
npm install string-escape-regexGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Tagged topics.
A tiny function for escaping a string to be used as the source in a regex.
npm install string-escape-regeximport escape from 'string-escape-regex';
// Let's escape a string to be used in a regex
escape ( 'foo()' ); // => 'foo\\(\\)'MIT © Fabio Spampinato
Estimated unpacked size across 1 packages.
2.4 kB
Includes dependencies.