I am trying to implement a form in Angular 2/4. There is a field for Telephone number. I used a regular expression as
pattern="^\s*(?:\+?(\d{1,3}))?[- (]*(\d{3})[- )]*(\d{3})[- ]*(\d{4})(?: *[x/#]{1}(\d+))?\s*$"
in the corresponding input field. It accepts almost all the formats but not the following:
754-3010 (Local)
(541) 754-3010 (Domestic)
+1-541-754-3010 (international)
More over it should accept +, -, (, and ) characters.
Hope some one can help