title: Splitting error eml using regex
body: <p>Hi I have an undelivered report as shown. I want to parse these using regex.</p>
  
  <pre><code>(&lt;from:.* to:.*&gt;)([\w\W]*) 
  </code></pre>
  
  <p>gives me the first how can I split into 3 emails and get only the details part.</p>
  
  <pre><code>.....
  .....
  bhahbhahbhahbhahbhahbhahbhahbhahbhahbhahbhah.....
  Message-Id: &lt;example@example.com&gt;
  
     This is the  mail gateway at gw.example.com.
  I'm afraid I wasn't able to deliver your message to the following addresses.
  This is a permanent error; I've given up. Sorry it didn't work out.
  
  &lt;name.surname@gmail.com&gt;:
   &lt;from:example@example.com to:name.surname@gmail.com&gt; 123.123.11.22 does not like recipient
  Remote host said: 550-5.1.1 The email account that you tried to reach does not exist. Please try
  550-5.1.1 double-checking the recipient's email address for typos or
  550-5.1.1 unnecessary spaces. Learn more at
  550 5.1.1 http://support.google.com/mail/bin/answer.py?answer=6596 asd123123.123 - gsmtp
  Giving up on 123.123.11.22.
  
  &lt;name.surname@hotmail.com&gt;:
   &lt;from:example@example.com to:name.surname@hotmail.com&gt; 21.32.54.65 does not like recipient
  Remote host said: 550 Requested action not taken: mailbox unavailable
  Giving up on 21.32.54.65.
  
  &lt;name.surname@ymail.com&gt;:
  &lt;from:example@example.com to:name.surname@ymail.com&gt;  &lt;from:example@example.com to:name.surname@ymail.com&gt; D12.123.12.12 failed after I sent the message.
  Remote host said: 554 delivery error: dd This user doesn't have a ymail.com account (name.surname@ymail.com) [0] - mta123.mail.ne1.yahoo.com
  
  --- Below this line is a copy of the message.
  
  Return-Path:
  bhahbhahbhahbhahbhahbhahbhahbhahbhahbhahbhah.....
  ....
  ....
  </code></pre>
  
  <p>Expected Output:</p>
  
  <pre><code>1: "123.123.11.22 does not like recipient\n    Remote host said: 550-5.1.1 The email account that you tried to reach does not exist. Please try\n    550-5.1.1 double-checking the recipient's email address for typos or\n    550-5.1.1 unnecessary spaces. Learn more at\n    550 5.1.1 http://support.google.com/mail/bin/answer.py?answer=6596 asd123123.123 - gsmtp\n    Giving up on 123.123.11.22.", 
  2: '21.32.54.65 does not like recipient\n    Remote host said: 550 Requested action not taken: mailbox unavailable\n    Giving up on 21.32.54.65.', 
  3: "D12.123.12.12 failed after I sent the message.\n    Remote host said: 554 delivery error: dd This user doesn't have a ymail.com account (name.surname@ymail.com) [0] - mta123.mail.ne1.yahoo.com"
  </code></pre>