pattern telefone js 1

pattern telefone js

/^\([1-9]{2}\) (?:[2-8]|9[1-9])[0-9]{3}\-[0-9]{4}$/

Here is what the above code is Doing:
1. ^ – start of string
2. \( – start of group
3. [1-9]{2} – two digits from 1 to 9
4. \) – end of group
5. (?:[2-8]|9[1-9]) – either a digit from 2 to 8 or 9 followed by a digit from 1 to 9
6. [0-9]{3} – three digits from 0 to 9
7. \- – a hyphen
8. [0-9]{4} – four digits from 0 to 9
9. $ – end of string

Similar Posts