Quick question, I have this isEmail function below. Should this cover
the basis for verifying an email address or am i missing an possibility?
# input : scalar
# output: true or false
sub isemail {
my($val) = shift(@_);
return 0 if (!defined($val));
return $val =~ /
^\w+(?:[\.-]?\w+)*@\w+(?:[\.-]?\w+)*(?:\.[a-zA-Z]{2,3}){1}$
|
^\w+(?:[\.-]?\w+)*@(?:\d{1,3}\.){3}(?:\d{1,3}){1}$
/x ? 1 : 0;
}
- Re: isEmail function Brett
- Re: isEmail function Mel Matsuoka
