Hello LADIES and Gentlemen,
Thank you to Jenda and Kathryn for your excellent tutorials. I
am going to get the hang of this one of these days. I have even
picked up the book Learning Perl from O'Reilly.
My current problem is I am testing an inputed email address
to verify that it is a valid string. Now by using this code
snippet:
###########################################################
if ($testmail =~ /(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/ ||
$testmail !~
/^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})(\]?)$/ ||
$testmail !~ /;<>*|`&$!#()\[\]{}:'"/ )
{
$error = "true";
}
###########################################################
I have been able to eliminate most invalid email addresses.
The only problem is recognizing that most email systems
and domain names have the capability of presenting a hyphen
(-) and the underscore (_) as valid characters in the username
or domain name.
I have spent the last 4 hours playing with this trying to
assess where in the comparison the hypen and the underscore
make this statement true.
I am certain that I am missing something that would be obvious
to someone with a lot more experience. Could someone tip me
off to what I am needing to look for?
Thank you.
Bill Platt
_______________________________________________
Perl-Unix-Users mailing list. To unsubscribe go to
http://listserv.ActiveState.com/mailman/subscribe/perl-unix-users