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