-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: louise.kitchen@enron.com
  To: wes.colwell@enron.com, georgeanne.hodges@enron.com, rob.milnthorp@enron.com, john.zufferli@enron.com, peggy.hedstrom@enron.com, thomas.myers@enron.com

Thank you

Ash
  • 23
  • 7

1 Answers1

0

Try to use something like:

 emails = re.findall('write your expression there', emailDataText)
voltento
  • 833
  • 10
  • 26