Last active
November 22, 2022 18:41
-
-
Save apeyroux/0e5b8768736b3bcecd9f08f724595ede to your computer and use it in GitHub Desktop.
This file contains hidden or 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
from email.utils import parseaddr | |
import re | |
_, mail = parseaddr("Alexandre Px <[email protected]>") | |
if mail == '': | |
print("Adresse mail non valide") | |
else: | |
match = re.split(r'\.-\.', mail, 1) | |
if len(match) == 2: | |
emetteur, balu = match | |
print("Emetteur : " + emetteur) | |
print("BALU : " + balu) | |
else: | |
print("Adresse mail n'est pas une balu") | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment