Reputation: 15
Been trying to set a field's behavior limitation to allow users to only enter 11 or 14 digits. the best I came up so far is to limit the range to be between 11 and 14, but I need it to be either or.
^([0-9]{11,14})+$
Can anyone help?
Upvotes: 0
Views: 82
Reputation: 115242
You can use |
for alternation
^([0-9]{11}|[0-9]{14})$
The above regex match either 11 or 14 digit string
Upvotes: 2