I am trying to validate phone number with RegEx. Below is my requirement. 10 Digits alpha/numeric, where an Alpha CHAR is in the 4th position (not including hyphen). For example: 586R410056
NNN ANN NNNN
(NNN) ANN NNNN
NNN-ANN-NNNN
(NNN) ANN-NNNN
1NNN ANN NNNN
1(NNN) ANN NNNN
1NNN-ANN-NNNN
1(NNN) ANN-NNNN
NNN.ANN.NNNN
(NNN-ANN-NNNN)
I came up with following RegEx, but it's not working in AngularJS form. RegEx:
^[1]?\s?\(?\d{3}\)?[-.\s]?[a-zA-Z]{1}\d{2}[-.\s]?\d{4}\)?$
Here is the plunker