http://www.perlmonks.org?node_id=393848


in reply to •Re^2: Please evaluate: RegEx for validating e-mail addresses
in thread Please evaluate: RegEx for validating e-mail addresses

I've only spent a few minutes looking for it, but my 2nd-edition Mastering Regular Expressions doesn't seem to include that regex. So I can't check my suspicion that the original MRE regex didn't actually match all RFC822 addresses, just most of them - I vaguely remember a disclaimer about comments in hostnames not being recognized, or some such. (Probably something recursive, now that I think about it.) Even Ovid's monstrous regex may not be complete.

--
F o x t r o t U n i f o r m
Found a typo in this node? /msg me
% man 3 strfry

  • Comment on Re^3: Please evaluate: RegEx for validating e-mail addresses

Replies are listed 'Best First'.
•Re^4: Please evaluate: RegEx for validating e-mail addresses
by merlyn (Sage) on Sep 25, 2004 at 20:44 UTC
    Yes, you remember almost correctly! The problem is nested comments. The oft-quoted monster regex deals with all comments, but no nested comments. Nested comments are impossible without resorting to trickery (a regex that only Perl could do because it has embedded Perl code).

    -- Randal L. Schwartz, Perl hacker
    Be sure to read my standard disclaimer if this is a reply.

Re^4: Please evaluate: RegEx for validating e-mail addresses
by tachyon (Chancellor) on Sep 26, 2004 at 07:26 UTC