-1

I want to extract all emails that are received the email. I used this regex to extract just emails after To, it just extracts the first email.

 To: ([a-z0-9_\.-]+@[\da-z\.-]+\.[a-z\.]{2,6})

And when I use this regex without To. It extracts the all emails wheather for reciver and sender.

 ([a-z0-9_\.-]+@[\da-z\.-]+\.[a-z\.]{2,6})

This is a sample of the data

  Message-ID: <7618763.1075855377753.JavaMail.evans@thyme>
  Date: Mon, 31 Dec 2001 10:53:43 -0800 (PST)
  From: [email protected]
  To: [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]

Thank you

1

1 Answer 1

0

Try to use something like:

 emails = re.findall('write your expression there', emailDataText)
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.