Ram Singh
Ram Singh

Reputation: 6938

Validation expression for telephone number including hypens?

I am using ajax mask for entering telephone number and now I want to validate the telephone number too. but I don't know what will be the validation expression to use with it.I have tried some but all vain. So please help me as soon as possible.I want to validate the number like 999-999-9999. Thank You

Upvotes: 1

Views: 3895

Answers (2)

Ram Singh
Ram Singh

Reputation: 6938

^[01]?[- .]?\(?[2-9]\d{2}\)?[- .]?\d{3}[- .]?\d{4}$

Upvotes: 0

Pankaj Kumar
Pankaj Kumar

Reputation: 1768

try this one

\d{3}-\d{3}-\d{4}

Upvotes: 2

Related Questions