B
Bill H
I have been using the following small routine to validate that an email
address is properly formatted and it works good with most email
addresses, but if the email address has more than 3 letters in the tld
(ie .info vs .com) it fails. Can someone tell me how to modify this to
make it work for more than 3 letters in the tld?
sub check_email
{
$email = $_[0];
if ($email =~ /(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/ || $email !~
/^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})(\]?)$/)
{
return 0;
}
else
{
return 1;
}
}
Thank you,
Bill H
P.S. I did not write this routine
address is properly formatted and it works good with most email
addresses, but if the email address has more than 3 letters in the tld
(ie .info vs .com) it fails. Can someone tell me how to modify this to
make it work for more than 3 letters in the tld?
sub check_email
{
$email = $_[0];
if ($email =~ /(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/ || $email !~
/^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})(\]?)$/)
{
return 0;
}
else
{
return 1;
}
}
Thank you,
Bill H
P.S. I did not write this routine