+ 1
Why isn't this code workin a expected?
import re s = 'Hello from shubhamg199630@gmail.com to priya@yahoo.com about the meeting @2PM' lst = re.findall('\S+@', s) print(lst) The above code should be extracting mail IDs from the string. instead it comes up with incomplete id like , shubhamg199630@... Why?
1 Answer
0
import re
s = 'Hello from shubhamg199630@gmail.com to priya@yahoo.com about the meeting @2PM'
lst = re.findall('\S+@\S+', s)
print(lst)
This working but may not exactly for other examples, am not checked..