Skip to content

Instantly share code, notes, and snippets.

@gausoft
Last active February 24, 2022 08:15
Show Gist options
  • Save gausoft/4ff85eb2414722776411448bf5e66f19 to your computer and use it in GitHub Desktop.
Save gausoft/4ff85eb2414722776411448bf5e66f19 to your computer and use it in GitHub Desktop.
Check if phone numbers without country code is a kind of Togolese phone numbers [Must be improved]

All supported phone numbers

 ^(2[2-7]|9[6-9]|70|79|9[0-3])\d{6}$

Explanation :

Correct examples : 22695482, 98615284, 92612381, etc.

Only TogoCom's Carrier phone numbers

^((70|79|9[0-3])\s?)\d{2}(\s?)\d{2}(\s?)\d{2}$

Phone Numbers :

  • 70 xx xx xx
  • 79 xx xx xx
  • 90 xx xx xx
  • 91 xx xx xx
  • 92 xx xx xx
  • 93 xx xx xx

Only Moov Togo's Carrier phone mumbers

^((9[6-9])\s?)\d{2}(\s?)\d{2}(\s?)\d{2}$

Phone Numbers :

  • 96 xx xx xx
  • 97 xx xx xx
  • 98 xx xx xx
  • 99 xx xx xx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment