Reputation: 2185
It would be great if someone could help me with a Regex for phone numbers. Following are the conditions:
Here are some valid numbers:
Thanks in advance
Upvotes: 16
Views: 41063
Reputation: 17350
Not exactly the answer to your question, but for those who need to work with phone numbers, there is a .NET port of Google's libphonenumber: libphonenumber-csharp.
Upvotes: 4
Reputation: 152284
Try with:
^\+?(\d[\d-. ]+)?(\([\d-. ]+\))?[\d-. ]+\d$
However it does not handle number counting
Upvotes: 26