use re 'Debug';
use re 'debugcolor';
Very useful for debugging.
Another great resource is:
I do feel like these subtle differences are the main cause of bugs in programs containing regexes; compounded by the fact they aren't super-readable, especially for people who don't use them frequently.
Tools like this are IMO really valuable for code reviews and it's nice to see that this one does have a flavour switch on the LHS with some of the main implementations.
... I should probably come up with some mappings so the \v is inserted automatically.
The best / easiest way that I've taught regex is to pop open a text editor and start searching for stuff. Start by searching for some letters, then a string with spaces, then a line break. From there I point people towards stuff like Apache config file conditionals / URL re-writes etc.
I thought I knew regexps, then I read "Mastering regular expressions". After that I was embarrassed. :-)
All history aside,
2: Mastering Regexp
3: The vim book has a great chapter on regular expressions (it's been ~10 years since I've touched it, but I remember being gifted a copy from a colleague of my father when I was in my teens and it helped me grok it)
The glibc programming manual is actually really comprehensive. kernel.org/docs/man-pages/ gives a pretty in depth analysis of POSIX.2 regex. I'm sure Perldocs also have PCRE's very well documented.
Anything else is going to give you a false negative sooner or later. Yeah, you can spend hours framing a complicated expression that carefully tests for exactly what the current bucket of RFCs specify, but you're guaranteed to run into an MTA somewhere that disagrees with you, and you can argue until the cows come home that you're right and they're wrong, but it's still you that's going to have to change to accommodate them in the end.
Validating emails with regexes is one of those things that seems like it should be fairly straightforward, but thanks to the language in the RFC it is actually a nightmare of rabbit holes filled with landmines.
I don't know about unicode, but I do note it says it doesn't handle comments (because, apparently, they can be nested - and perl's REs lack recursion).
Really. Email addresses should have never been allowed to have comments.
Since every new RFC maintains compatibility with this one, we'll probably be stuck with these poor choices for decades.
Have further RFCs not deprecated most of the braindamage from 822? If not, why? Are there really people who are still trying to use such horrible abominations for their email address?
I guess this is what you're referring to: James Doe <firstname.lastname@example.org>
The email - which is inside the <> - should be parsed correctly, while the rest should be treated as a "comment" .
* comments are allowed with parentheses at either end of the local-part; e.g. john.smith(comment)@example.com and (comment)email@example.com are both equivalent to firstname.lastname@example.org. 
* Also have a look at quotes
* "Fred Bloggs"@example.com
At first I thought you were a bot. Then that your English was not very good.
Looking at your history clearly both are false.
What did you mean?
(rest of the page is filled with line noise)
In any case, it probably won't be too long before we get emoji TLDs, or UTF8 flags to replace the country-code :-D
The only regret I have is that many of the interesting regexes we see in the course of our work are not something which we can type into someone else's web site. Fortunately there are others who have looked at the idea of making an off-line version:
Regex is weird anyway but it's often a surprise just some weird string that's close to what you thought you wanted comes up.