title: PHP Regular expression: exclude href anchor tags
body: <p>I'm creating a simple search for my application.</p>
  
  <p>I'm using PHP regular expression replacement (preg_replace) to look for a search term (case insensitive) and add <code>&lt;strong&gt;</code> tags around the search term.</p>
  
  <p><code>preg_replace('/'.$query.'/i', '&lt;strong&gt;$0&lt;/strong&gt;', $content);</code></p>
  
  <p>Now I'm not the greatest with regular expressions. So what would I add to the regular expression to not replace search terms that are in a <code>href</code> of an anchor tag?</p>
  
  <p>That way if someone searched "info" it wouldn't change a link to "http://something.com/this_<code>&lt;strong&gt;</code>info<code>&lt;/strong&gt;</code>/index.html"</p>