![]() |
|
The stupid question is the question not asked | |
PerlMonks |
Re: regex to validate e-mail addresses and phone numbersby Abigail-II (Bishop) |
on Feb 10, 2004 at 14:25 UTC ( [id://327928]=note: print w/replies, xml ) | Need Help?? |
Regular expressions that do a syntactical validation of
email addresses are not simple. They will contain thousands
of bytes, and use constructs that have been marked 'experimental'.
There are however several modules that check the correctness of email addresses. As for phone numbers, that's almost impossible to do. You might URIfy the phone number, and use Regexp::Common, but that most likely is just going to check whether you have a string of numbers. RFC 2806 deals with telephone URIs, but it doesn't concern itself with the validity of the number part in any existing number plan. Abigail
In Section
Seekers of Perl Wisdom
|
|