Validation of Phone Numbers including optional country code and area code
numbers = ['(210) 867 5309',
'+1 210.867.5309',
'867-5309',
'210-867-5309']
regex = r"^\(?\+?([0-9]{1,3})?[- (]?\(?([0-9]{3})?[-. )]?\(?([0-9]{3})[-. )]?\(?([0-9]{4})\)?\s?$"
re.search(regex, phone_number)
Submitted by Cristina Lucin - 2 years ago