escape-string-regexp alternatives and similar modules
Based on the "Text" category.
Alternatively, view escape-string-regexp alternatives based on common mentions on social networks and blogs.
-
nanoid
Tiny, secure, URL-friendly, unique string ID generator. -
Numeral.js
A javascript library for formatting and manipulating numbers. -
Underscore.string
Collection of string manipulation utilities. -
i18n-node
Simple translation module with dynamic JSON storage. -
camelcase
Convert a dash/dot/underscore/space separated string to camelCase: foo-bar โ fooBar. -
strip-indent
Strip leading whitespace from every line in a string. -
parse-columns
Parse text columns, like the output of Unix commands. -
unhomoglyph
Normalize visually similar unicode characters. -
splice-string
Remove or replace part of a string like Array#splice. -
hanging-indent
Format a string into a hanging-indented paragraph.
Scout APM - Leading-edge performance monitoring starting at $39/month
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest. Visit our partner's website for more details.
Do you think we are missing an alternative of escape-string-regexp or a related project?
README
escape-string-regexp 
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.
Get professional support for this package with a Tidelift subscription Tidelift helps make open source sustainable for maintainers while giving companiesassurances about security, maintenance, and licensing for their dependencies.