Also if there is is an hyphen as first separator, you accept dot as second separator...
(\d)$/ the first part of the older regex didn't do well: "(()?
The validating phone number is an important point while validating an HTML form.
In this page we have discussed how to validate a phone number (in different format) using Java Script : At first, we validate a phone number of 10 digits with no comma, no spaces, no punctuation and there will be no sign in front the number.
these are accepted: 5555555555 555-555-5555 (555)555-5555 1(555)555-5555 1 5 1 555-555-5555 1 (555) 555-5555 these are not accepted: 555-5555 - to accept this use: ^ ?
All of the above attributes also allow you to specify an error message that is displayed in the event of an error.