I'm trying to scrape names from a chunk of text (from an email body actually) that normally looks similar to this:
From: aaa@aaa.com
CC: John Smith <aaa@aaa.com>, Charles <aaa@aaa.com>, Mary Lamb <aaa@aaa.com>, Chino <aaa@aaa.com>, Claudia <aaa@aaa.com>, <aaa@aaa.com>, <bbb@bbb.com>, John <aaa@aaa.com>
Hi there AAA! Hope you had a wonderful time
Best,
AAA
I would like to end up with a list variable that holds only the names (first and last if available) of everyone on the CC, discarding the rest of the information. What would be a simple and clean approach using regex? (this is not a test, it's a real app I'm working on and am stuck...). I already was able to extract all emails using a re.findall() with an email matching pattern I found.
Thanks