# extract an email ID from the text using regex Text = "This is the text which contains emails IDs . My email is myemail@gmail.com." import re re.findall(r"([w.-]+@[w.-]+)", Text) output: ['myemail@gmail.com.']