Home > database >  Writing a regexp code for saudi arabia phone number using dart, flutter
Writing a regexp code for saudi arabia phone number using dart, flutter

Time:02-14

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

  1. must start with 9665xxxxxxxx
  2. length after 966 must be 9 digits.
  3. it should not have 96605xxxxxxxx.

examples:

  1. 966551234567
  2. 966506478971

CodePudding user response:

For a string that starts with 9665 and exactly 8 digits behind it.

^[ ]9665[0-9]{8}$
  • Related