finding email id from string python

Solutions on MaxInterview for finding email id from string python by the best coders in the world

showing results for - "finding email id from string python"
Jordyn
05 Nov 2017
1import re
2
3my_str = "Hi my name is John and email address is john.doe@somecompany.co.uk and my friend's email is jane_doe124@gmail.com"
4emails = re.findall("([a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+)", my_str)
5
6for mail in an email:
7print(mail)