I used a non-greedy(lazy) +? operator but it is being greedy
I expect the RE \S+?@\S+ when matched against the string 'From [email protected] Sat Jan 5 09:14:16 2008' to match '[email protected]', but it matched '[email protected]'.
Below is the Python code I used.
import re
string = 'From [email protected] Sat Jan 5 09:14:16 2008'
out = re.findall('\S+?@\S+', string)
print(out)
When I tried the same string and pattern in Notepad++, I got the same result.