in reply to validate an email address ?
If you want decent validation, try Email::Valid.
If you want your code to be readable, please wrap it in <code> tags.
Now, to the immediate problem: is this cut and pasted? Your regex (as posted) is attempting to find things that *DON'T* match your pattern, i.e. $emailcheck will only be incremented if the address isn't in the format you've specified. While we're at it, here's the syntax for checking $emailaddress directly, with a little of Perl's syntactic neatness thrown in:
$emailcheck++ if $emailaddress =~ /@[a-z0-9]+\.[a-z0-9]+/i;
HTH
Philosophy can be made out of anything. Or less -- Jerry A. Fodor
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: validate an email address ?
by boo_radley (Parson) on Feb 16, 2001 at 22:38 UTC | |
by rpc (Monk) on Feb 16, 2001 at 23:04 UTC |