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"; } #### if($mail_id=~/^[\w\.=-]+@[\w\.-]+\.[\w]{2,3}$/) { print "matched \n"; } else { print "Not matched \n"; }