RegEx for valid international mobile phone number

Petrus Theron picture Petrus Theron · Feb 21, 2011 · Viewed 120.2k times · Source

I use Clickatell to send SMSes to clients' mobile phones.

Is there a standardised regular expression for all valid mobile phone numbers, e.g. +27 123 4567? I'd roll my own, but I'm worried about missing an obscure, valid phone number format.

Answer

Jannie Theunissen picture Jannie Theunissen · May 9, 2011

After stripping all characters except '+' and digits from your input, this should do it:

^\+[1-9]{1}[0-9]{3,14}$

If you want to be more exact with the country codes see this question on List of phone number country codes

However, I would try to be not too strict with my validation. Users get very frustrated if they are told their valid numbers are not acceptable.