Re: Regex for telephone numbers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux