title: RegEx for parsing "Diagnostic-Code" in a bounced e-mail
body: <p>I'm trying to read bounced e-mails by connecting via PHP to a IMAP account and fetching all e-mails. I'm looking to retrieve the "Diagnostic-Code" message for each e-mail and I wrote the following regex:</p>
  
  <pre><code>/Diagnostic-Code:\s+?(.*)/i
  </code></pre>
  
  <p>The message that I'm trying to parse is this:</p>
  
  <pre><code>Diagnostic-Code: smtp; 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
      https://support.google.com/mail/?p=NoSuchUser 63si4621095ybi.465 - gsmtp
  </code></pre>
  
  <p>The regex works partly meaning it only fetches the first row of text. I want to be able to fetch the entire message, so all the four rows of text.</p>
  
  <p>Is it possible to update the expression to do this matching?</p>
  
  <p>Thanks.</p>