Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: regex to validate e-mail addresses and phone numbers

by Abigail-II (Bishop)
on Feb 10, 2004 at 14:25 UTC ( [id://327928]=note: print w/replies, xml ) Need Help??


in reply to regex to validate e-mail addresses and phone numbers

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

  • Comment on Re: regex to validate e-mail addresses and phone numbers

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://327928]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (3)
As of 2025-07-19 12:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.