Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Re: Re: regex to validate e-mail addresses and phone numbersby seanbo (Chaplain) |
on Feb 10, 2004 at 21:21 UTC ( [id://328036]=note: print w/replies, xml ) | Need Help?? |
FWIW, I use:
/^\w+\@([\da-zA-Z\-]{1,}\.){1,}[\da-zA-Z-]{2,6}$/
The main idea is that an "_" (underscore) matches on \w, but is not valid as part of a domain name. It is, however, acceptable as part of the username.
I use {2,6} since the there are some tld's longer than 4 chars (.museum for example).
perl -e 'print reverse qw/o b n a e s/;'
In Section
Seekers of Perl Wisdom
|
|