For more see http://en.wikipedia.org/wiki/Email_address#Valid_email_addre...
For more see http://en.wikipedia.org/wiki/Email_address#Valid_email_addre...
The more corner cases you have to consider, the more unreadable the code gets, after a while by seemingly exponential degree.
And if you have a tool to build the regex, why not just use the tool's code as your source so the final result is readable.
Basically, pasting a big regex into your code hardly seems more desirable than pasting a bunch of assembler there. But assembler can unavoidable. This isn't.
Regex are cool as CS constructs though.
If you are having severe problems with a regex, the issue might be that you need to use an actual parser rather than a simple pattern matcher.
If you know context-free language, recursive-descent parsers are fairly simple to write and maintain without any special tools.
I think it is clear that this isn't the point.
There was a fun proposal to avoid spam by adding comments inside your email address. Any true emailer should handle it. And regex should break.
Unfortunately Microsoft Exchange breaks. And that case is important enough that the idea never caught on.
The term "works" is relative of course - I don't suppose anyone actually uses that regex!