Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

email regular expression

Status
Not open for further replies.

cnw40007

Technical User
Mar 4, 2003
35
IE
Hi below are 2 regexps that i have tried. Either are supposed to print out any email that has a number in the higher domain.There not giving me any errors but there not working either can anybody show me an easier way please.
-- ([0-9a-zA-Z\.\-\_])+\@[0-9a-zA-Z\.\-]\.[\w]{4,5}[0-9]{1,})$/ )

--
/\.([a-zA-Z]{2,3})$/

Thanks cnw40007.
 
Code:
my $DATA = 'nospam@youremail9.co.uk';
my ($email, $domain) = split (/\@/, $DATA);
my ($firstpart) = split (/\./, $domain);
$firstpart =~ /[0-9]/ ? print "yay!" : print "duh!";

see if this works for you? ---
cheers!
san
pipe.gif


"The universe has been expanding, and Perl's kind of been expanding along with the universe" - Larry Wall
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top