Search code examples
regex

Writing a Regex for Kuwait Mobile number in international format


I need a regex to match following:

  • total string length 12
  • first four characters must be +965
  • fifth character either 5, 6 or 9
  • followed by 7 digits [0-9]
  • nothing else allowed

Any help regarding this shall be highly appreciated.


Solution

  • Based on help extended by Pranav and Tim, the regex for kuwait mobile is +965[569]\d{7}$

    working fine with simfatic forms. Thanx for the help.