|
Posted by Slickuser on June 10, 2008, 12:33 am
Please log in for more thread options
So you want
sam._@abc.org
sam_.@abc.org
to be invalid while
sam@abc.org
sam_a@abc.org
sam.b@abc.org
sam.a_b@abc.org??
> Hello,
> I use the following regular expression to catch typical invalid email
> addresses:
> ------------
> my @Email=("sam._\@abc.org", "sam_.\@abc.org", "sam_.\@abc.org");
> foreach (@Email)
> {
>
>
if(/^[A-z0-9]+([_\.][A-z0-9\-]+)*[@][A-z0-9_\-]+([.][A-z0-9_\-]+)?\.[A-z]$/)
> { print "$_ is a valid email id\n"; }
> else
> { print "$_ is an invalid email id\n"; }}
>
> -------------
>
> This expression does not catch the above 3 emails in the array (the
> program says that they are valid emails).
>
> Can someone help me to discard these three?
> Thanks.
|