Validate few characters of phone number in jquery

mgmhicks used Ask the Experts™
I have a situation where I have a field that I would like to take the following format to be valid.  (999) 255-5555.  However I can have the word 'work' or cell etc... So how can I validate the first few characters (the phone number) but still allow the text after if needed?

Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Using the technique shown here you then just need to customise the regular expression to what you want. So instead of what they are using


You could use :

/^(\([0-9]{3}\) |[0-9]{3}-)[0-9]{3}-[0-9]{4}/

Which will allow the formats:

(123) 123-1234

With anything after them.
Pravin AsarPrincipal Systems Engineer
Top Expert 2005


Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial