Correct parsing of email addresses using a regular expression is extremely difficult, but for the simplified case, with a simple definition of the word ~ \w\.\w and email ~ any sequence that contains @ , you can find this regular expression to do what you need:
>>> re.findall(r"(?:^|[:\s]+)(\w+\.\w+)(?=[:\s]+|$)", "aa bb:cc d.d@e.e.e ") ['a.a', 'b.b', 'c.c']
The trick here is not to focus on what comes in the next or previous word, but on what should look like at the moment.
Another trick is to correctly identify word delimiters. Before the word, we allow a few spaces : and the beginning of the line, consuming these characters, but not capturing them. After the word that we need is almost the same (except for the end of the line, instead of starting), but we do not consume these characters - we use the lookahead statement.
source share