The regular expressions below can be used to validate if a string is a valid phone number format and to extract a phone number from a string. Please note that this validation can not tell if a phone number actually exists.
A simple regex to validate string against a valid international phone number format without delimiters and with an optional plus sign:
True
False
Enter a text in the input above to see the result
Example code in Python
This regular expression will match phone numbers entered with delimiters (spaces, dots, brackets, etc.)
True
False
Enter a text in the input above to see the result
Example code in Python
True
False
Enter a text in the input above to see the result
While validation of phone numbers using regex can give a possibility to check the format of the phone number, it does not guarantee that the number exists.
There might be also an option to leave a phone number field without any validation since some users might have:
Discover UI Bakery – an intuitive visual internal tools builder.