A line in my PHP script tests for bad email addresses with the following regular expression:
...
if (!ereg("[EMAIL PROTECTED],5}$", $email))
...
However, this expression evaluates email addresses like [EMAIL PROTECTED]" and "[EMAIL PROTECTED]" as incorrect. It's the subdomain or two dots after the @ sign that causes the problem. How can I change my expression above to allow email addresses with subdomains?
Also, if I am going to worry about (and allow) email addresses that have 2 dots after the @ sign, should I worry about there being email addresses with 3 or more dots? What expression would handle an infinite number of dots after the @ sign?
Thanks!
Richard
(Am I asking this just 10 hours premature?)
smime.p7s
Description: S/MIME cryptographic signature
____________________ BYU Unix Users Group http://uug.byu.edu/ ___________________________________________________________________ List Info: http://uug.byu.edu/cgi-bin/mailman/listinfo/uug-list
