title: php Regex on email addresses
body: <p>trying to filter out some specific email addresses.  I run a query which returns data like so</p>
  
  <pre><code>smtp:email@email.local
  X400:C=GB;A= ;P=TRACK;O=Exchange;
  SMTP:email@email.com
  
  smtp:Email.4c1f4d8b-8179-4148-93bf-00a95fa1e042@email.com
  X400:c=GB;a= ;p=TRACK;o=Exchange;s=Email.4c1f4d8b-8179-4148-93bf-0;
  smtp:Email.4c1f4d8b-8179-4148-93bf-00a95fa1e042@email.co.uk
  smtp:Email.4c1f4d8b-8179-4148-93bf-00a95fa1e042@email.local
  
  X400:c=GB;a= ;p=TRACK;o=Exchange;s=Mailbox D919BA05-46A6-415;
  SMTP:Mailbox{D919BA05-46A6-415f-80AD-7E09334BB852}@email.com
  smtp:Mailbox{D919BA05-46A6-415f-80AD-7E09334BB852}@email.co.uk
  smtp:Mailbox{D919BA05-46A6-415f-80AD-7E09334BB852}@email.local
  </code></pre>
  
  <p>What I need to return is "normal" email addresses.  So from the above, I need to return</p>
  
  <pre><code>smtp:email@email.local
  SMTP:email@email.com
  </code></pre>
  
  <p>First of all, I need to get rid of anything that does not start with smtp/SMTP.  The abnormal email address have 3 or hyphens before the @ symbol.  I was thinking I could use this to get rid of the bad email addresses.</p>
  
  <p>I have attempted something that kind of works, but I do not think it is the best.  What I have is</p>
  
  <pre><code>/smtp:\w+(-\w+)?@.*/im
  </code></pre>
  
  <p>Whats the best way to get the good email addresses out of my list?</p>
  
  <p>Thanks</p>