hi,
I am using the following regular expressions for validating a mail id
my $mail_id = 'data@mach.com.com';
if($mail_id=~/[A-Za-z0-9._%-]\@[A-Za-z0-9_%-.].[com]/)
{
print "matched \n";
}
else
{
print "Not matched \n";
}
also i have used this regular expression:
if($mail_id=~/^[\w\.=-]+@[\w\.-]+\.[\w]{2,3}$/)
{
print "matched \n";
}
else
{
print "Not matched \n";
}
But unforunately both of them are matching .com.com
I would like to match excatly one .com . How can this be accomplished. Any help would be grately appreciated.
Thanks & Regards,
Pavan