regex is a template tag that extends JavaScript regular expressions with features that make them more powerful and dramatically more readable. It returns native RegExp instances that equal or exceed native performance. It's also lightweight, supports all ES2024+ regex features, and can be used as a Babel plugin to avoid any runtime dependencies or added runtime cost.
Highlights include support for free spacing and comments, atomic groups via (?>…) that can help you avoid ReDoS, subroutines via \g<name> and definition groups via (?(DEFINE)…) that enable powerful subpattern composition, and context-aware interpolation of regexes, escaped strings, and partial patterns.
With the regex package, JavaScript steps up as one of the best regex flavors alongside PCRE and Perl, and maybe surpassing C++, Java, .NET, and Python.
This is a newer collection. The older page that's currently linked seems to no longer be actively maintained, and it includes a lot of dead links that now point to spam sites, along with a lot of suboptimal links to tools and resources that are not best in class.
Thanks for the great book, Sundeep!
For the Further Reading page, I have a couple suggestions:
1: The
regex
library. From its readme:2: I'd recommend updating the "Awesome Regex" link to point to https://github.com/slevithan/awesome-regex
This is a newer collection. The older page that's currently linked seems to no longer be actively maintained, and it includes a lot of dead links that now point to spam sites, along with a lot of suboptimal links to tools and resources that are not best in class.