So I’m learning about regular expressions and I came accross an exercise which is about the email from this line :
x = "From email@example.com Sat Jan 5 09:14:16 2008"
I already know the solution but I was looking for the “non-greedy” answer which should give me “d@u” as the answer but I can’t get it to work. Here’s what I’ve come up with
y = re.findall('\S+?@\S+?',x) print(y)
which results in :
Any ideas on what I have to do in order to make it work ?