I'm trying to scrape names from a chunk of text (from an email body actually) that normally looks similar to this:
From: [email protected]
CC: John Smith <[email protected]>, Charles <[email protected]>, Mary Lamb <[email protected]>, Chino <[email protected]>, Claudia <[email protected]>, <[email protected]>, <[email protected]>, John <[email protected]>
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