I want to parse phone numbers from many countries around the world using a regex I need the phone numbers I can come in many different ways and need to catch them all.
Examples.
00212 23254324
+212 324324324
232 2 121 343
234/2354323
122 232 23 213
3123-321-321
With bars, spaces, dashes.
Thanks
Based on the fact that there are numerous telephone number formats with different separators, different prefixes and symbols, I don’t think that regex can really match all of those cases (there are a lot more cases than you have listed there).
If you want to validate them, I suggest you count the digits (ignoring symbols and separators) and check if there are enough digits to form a valid phone number.
This way is much more easier to store them or convert them in your format : you can extract all the digits from the number and then format the number in what way you want.
Hope this helps!