title: regex to replace mailto: hrefs but ignore site links
body: <p>I need some help to tweak this regular expression:</p>
  
  <pre><code>$content = 'more &lt;a href="http://www.test.com"&gt;test&lt;/a&gt; test &lt;a href="mailto:jeff@test.com"&gt;Jeff&lt;/a&gt; this is a &lt;a href="http://www.test.com"&gt;test&lt;/a&gt;';
  
  $content = preg_replace("~&lt;a .*?href=[\'|\"]mailto:(.*?)[\'|\"].*?&gt;.*?&lt;/a&gt;~", "$1", $content); 
  </code></pre>
  
  <p>This expression is to strip the html markup off a mailto link and just return the email (jeff@test.com)</p>
  
  <p>It works fine except for in the example I gave above - because a unlimited number of whitespaces is allowed before the href in the pattern, when a website link is before the mailto link, the regex looks all the way forward until it finds the mailto: in the following link and removes all the content in between.</p>
  
  <p>maybe a fix would be to just limit it to two or three whitespaces after the opening tag so as  to not look so far ahead, but i wonder if there is a better solution from people who know regex better than I?</p>