which I’ve called XRegExp. This script is very small (the minified version weighs in at 937 bytes), and it adds support for two simple but powerful additional flags
- s – Dot matches all (a.k.a.,
- x – Free-spacing and comments mode.
It also allows you to use these
flags with the RegExp constructor itself after running one line of code.
Additionally, XRegExp improves some minor cross-browser regex syntax consistency
Regexes built using XRegExp are
identical in speed to those built using the native RegExp constructor, support
If you would like to receive an email when updates are made to this post, please register here
Subscribe to this post's comments using