I'm new to Python and am getting confused. I have a list of email strings and want to get the string after some specific text and before some text. So from the list below;
Email: promo@madeup.com
Email: dave@madeup.com
Email: john@madeup.com
get the following;
promo@madeup
dave@madeup
john@madeup
I've managed to get the first string (below) but can't seem to get all of them
import re
lines = '''
Email: promo@madeup.com
Email: dave@madeup.com
Email: john@madeup.com
'''
emailAddr = lines.split('Email:')[1] #start
emailAddr2 = emailAddr.split('.com')[0] #end
print(emailAddr2)