pavanmach has asked for the wisdom of the Perl Monks concerning the following question:
also i have used this regular expression: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"; }
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, Pavanif($mail_id=~/^[\w\.=-]+@[\w\.-]+\.[\w]{2,3}$/) { print "matched \n"; } else { print "Not matched \n"; }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: About validating mail id
by Corion (Patriarch) on Feb 03, 2010 at 12:14 UTC | |
by tirwhan (Abbot) on Feb 03, 2010 at 12:23 UTC | |
by JavaFan (Canon) on Feb 03, 2010 at 13:09 UTC | |
by tirwhan (Abbot) on Feb 03, 2010 at 14:17 UTC | |
by JavaFan (Canon) on Feb 03, 2010 at 16:26 UTC | |
| |
Re: About validating mail id
by FunkyMonk (Chancellor) on Feb 03, 2010 at 13:12 UTC | |
Re: About validating mail id
by scorpio17 (Canon) on Feb 03, 2010 at 14:38 UTC | |
Re: About validating mail id
by ww (Archbishop) on Feb 03, 2010 at 12:33 UTC | |
|