[wp-hackers] is_email

Dougal Campbell dougal at gunters.org
Fri Mar 25 18:18:50 GMT 2005


John Sinteur wrote:
> [...]

> The grammar described in RFC 822 is suprisingly complex. Implementing 
> validation with regular expressions somewhat pushes the limits of what 
> it is sensible to do with regular expressions.
> 
> I'm about to paste the full regular expression into this mail below, if 
> your mail reader borks on it, visit 
> http://www.ex-parrot.com/~pdw/Mail-RFC822-Address.html
> 
> (?:(?:\r\n)?[ \t])*(?:(?:(?:[^()<>@,;:\\".\[\] 
>  [...etc, etc, etc, etc, etc...]
> \t])*))*\>(?:( ?:\r\n)?[ \t])*))*)?;\s*)

Wow. That just kicks ass :)

Maybe not very practical, but very ass-kicking.

-- 
Dougal Campbell <dougal at gunters.org>
http://dougal.gunters.org/



More information about the wp-hackers mailing list