import re
# goal: phone number is ddd-ddd-dddd
s = input('Phone number: ')
#print(s)
match = re.match('^(0|1|2|3|4|5|6|7|8|9)*$', s) # regex, string
match = re.match('^\d\d\d-?\d\d\d-?\d\d\d\d$', s) # regex, string
match = re.match('^\(?(\d{3})\)?-?(\d{3})-?(\d{4})$', s) # regex, string
if match:
print('Match!')
print(match.groups())
else:
print('No match.')