In order to be able to make the regular expression, we need a better description from you.
As what you have described so far, you can enter also:
12)8-0(-(78)8
the regular expression would be:
^[\d\)\-\s]*$
But what you need to tell us is:
- must there be at least one digit or not? for example is "" allowed or "()" or "1" or "(1)"?
- is a hyphen after a bracket allowed?
- only one opening and only one closing bracket or many? Are the brackets a must? e.g. "(123)1234-123-(0)" or "123-123-1222"?
- exactly how many hyphen? Are they a must?
- how many digits (min, max) at all? How many inside bracket? how many between which hyphen?
- are leading zeros allowed? (international calls) "0049-90123" versus "090123" versus "90123"?
- how do you note an office extension? Brackets or hyphen or space?
- What type of space can he enter? (tab, carriage-return, spacebar)
As you know,different countries have different rules for legal phone numbers. There are already a lot of regular expressions that you can google for for main countries like USA, England, Germany, India etc.. So which country do you want to implement (if any)?