Validating/converting E.164 phone numbers

From: Colin Viebrock (colin@easydns.com)
Date: Fri Oct 17 2003 - 15:52:07 EDT


I'm trying to come up with some code (PHP, but that's not important) to
convert and validate any phone number that a user types in into an
E.164 valid number.

Two questions:

1. is there a regex or description of what makes a valid E.164 number?
All I can find is that the number needs to be in the following format

        +AAA.BBBBBBBBBBBxCCCC

Where AAA is the country code, BBBBBBB is everything else (ie. area
code + exchange + number), and xCCCC is the optional extension.

2. Anyone have any code to try and convert phone numbers typed in other
formats into E.164?

- Colin



This archive was generated by hypermail 2.1.3 : Tue Oct 19 2004 - 23:37:48 EDT