After stalling for nearly a year, I've finally released XRegExp 1.0, the next generation of my JavaScript regular expression library. Although it doesn't add support for lookbehind (as I've previously suggested) due to what would amount to significant inherent limitations, it fixes a couple bugs, corrects even more cross-browser regex inconsistencies, and adds a suite of new regular expression functions and methods that make writing regex-intensive JavaScript applications easier than ever. One of these new functions, XRegExp.addToken
, fundamentally changes XRegExp's implementation and allows you to easily create your own XRegExp plugins.
Here's XRegExp's abbreviated feature list from the brand new xregexp.com (which includes extensive documentation and code examples):
- Adds new regex and replacement text syntax, including comprehensive support for named capture.
- Adds two new regex flags:
s
, to make dot match all characters (aka singleline mode), andx
, for free-spacing and comments (aka extended mode). - Provides a suite of 12 functions and methods that make complex regex processing a breeze.
- Automagically fixes the most commonly encountered cross-browser inconsistencies in regex behavior and syntax.
- Lets you easily create and use plugins that add new syntax and flags to XRegExp's regular expression language.
The full list of changes can be seen in the changelog. Please let me know if you find any bugs or have any suggestions for the library. I'd also love to hear about projects or sites that are using XRegExp (I've got a few listed on the XRegExp homepage now).