I have a very large .txt file with hundreds of thousands of email addresses scattered throughout. They all take the format:
...... >
import re reg_pat = r'\S+@\S+\.\S+' test_text = 'xyz.byc@cfg-jj.com ir_er@cu.co.kl uiufubvcbuw bvkw ko@com m@urice' emails = re.findall(reg_pat ,test_text,re.IGNORECASE) print(emails)
Output:
['xyz.byc@cfg-jj.com', 'ir_er@cu.co.kl']