JavaScript: jQuery RegEx Review

This was too good to not repost… If you have any interest at all in JavaScript performance optimization, then this publication by Jeff Roberson will be of great interest. In this article Jeff dissects RegEx’s found in jQuery and provides insight as well as suggestions to improve them either in performance or syntax. Each example is detailed with the original RegEx, the module it can be found in, the line number it is located at, a suggested revision and a descriptive, explanatory analysis of his revision.

jQuery Regular Expressions Review


We moved off of Disqus for data privacy and consent concerns, and are currently searching for a new commenting tool.

  1. Since I can’t find any other way to contact you, Jeff (having tried for all of 2 minutes…) can I use this forum to thank you?

    I’ve just applied your \\b(?: optimisation to my javascript-based test engine and seen a 5x performance boost matching in LARGE strings. Now to get cracking with the rest…

Contact Us

We'd love to hear from you. Get in touch!


P.O. Box 961436
Boston, MA 02196