I am using RegEx to extract some data from a txt file. I've made the below for-loops to extract emails and birthdates and (tried) to append the outputs to a list. But when I print my list only the first appended output is printed. The birtdate RegEx works fine when run by itself. I'm sure I'm doing something very basic wrong.
f = open("/Users/me/Desktop/scrape.txt", "r", encoding="utf8")
list = []
for i in f:
if re.findall(r"((?i)[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.])", i):
list.append(i)
for k in f:
if re.findall(r'\d\d-\d\d-\d\d\d\d', k):
list.append(k)
print(list)
f.close()