1# Visit: https://regexr.com/
2# and look at the Menu/Cheatsheet
3import re
4
5# Extract part of an email address
6email = 'name@surname.com'
7
8# Option 1
9expr = '[a-z]+'
10match = re.findall(expr, email)
11name = match[0]
12domain = f'{match[1]}.{match[2]}'
13
14# Option 2
15parts = email.split('@')