Created
January 8, 2021 20:01
-
-
Save afr-dt/93f7ba432f50e7fa2fc4da3ceba09738 to your computer and use it in GitHub Desktop.
Validate phone with + symbol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
def validate_phone(phone): | |
if re.match(r'^\+1?\d{9,15}$', phone): | |
print(f'{phone} is valid number') | |
else: | |
print(f'{phone} is not valid') | |
validate_phone('+52558397') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment