I want to write a regexp
code for the Saudi Arabia phone number so I can test it on my app, the restriction is that
- must start with 9665xxxxxxxx
- length after 966 must be 9 digits.
- it should not have 96605xxxxxxxx.
examples:
- 966551234567
- 966506478971
CodePudding user response:
For a string that starts with 9665
and exactly 8 digits behind it.
^[ ]9665[0-9]{8}$