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
    there's also RFC822 if email valid doesn't work.

    And doesn't japhy's OGRE have a "real" 822 validating regexp for a test case? a regexp that's, oh, 500 lines long?

      The version of Email::Valid on my machine (0.12) uses the RFC822 pattern.