12345678910111213import res = input('Email address: ')# match looks from start string, doesn't require consuming all# search looks in the middlematch = re.match('([a-zA-Z][a-zA-Z0-9_.]*)@([a-zA-Z0-9][a-zA-Z0-9._]*[a-zA-Z0-9])', s)if match:print('Match!')print(match.groups())else:print('Not valid')