Re: Regex for telephone numbers

From: Date: Fri, 31 Dec 2010 14:03:31 +0000
Subject: Re: Regex for telephone numbers
References: 1 2 3 4  Groups: php.general 
Request: Send a blank email to php-general+get-310420@lists.php.net to get a copy of this message
At 07:11 AM 12/31/2010, Nathan Rixham wrote:
Ethan Rosenberg wrote:
FYI [to all the list] -- I thank all for their input. I only needed US phones, and I am forcing the user of the form to conform to xxx-xxx-xxxx as the input format.
out of interest, why are you forcing you're users to conform to that input format? you could simply strip all non-numeric chars then format how you like to save, thus giving users a looser, more friendly, experience. +++++++++
Nathan - This expression will be used to search a database which will contain patient data resulting from medical research. At the initial visit a medical record number will be assigned to the patient. Other information will be collected at that point; eg, the telephone number. At subsequent visits, the patient will be referenced by his/hers medical record number. If the patient either forgot their clinic card, or cannot remember their medical record number, a search will be performed. One of the many parameters that can be used in the search is the phone number. It is easier if all the data has a fixed format. The form for the initial visit will use a regex that will validate the phone number. As the research will be performed in the US, only US numbers have to be validated. Hope this helps. Ethan

« previous php.general (#310420) next »