title: PHP preg_replace URI's in phpBB
body: <p>I'm trying to replace some image URI's in some phpBB forum post content retrieved from the DB for an external page.</p>
  
  <pre><code>preg_replace('/((https?|ftp).*\.(gif|png|jpg|jpeg))/i', '&lt;img src="$1" alt "" /&gt;','http://somesite.com/image.png awordcontainingpng');
  </code></pre>
  
  <p>The above works well and as expected.</p>
  
  <p>The thing is, when I try to apply the same to the MySQL result, nothing gets matched.  Matches seem to work when I remove the escaped dot</p>
  
  <p>E.g.:</p>
  
  <pre><code>preg_replace('/((https?|ftp).*(gif|png|jpg|jpeg))/i', '&lt;img src="$1" /&gt;',$phpbb_post);  
  </code></pre>
  
  <p>But that's no good.  The data is BLOB type - I don't know if that makes a difference.  Could anyone help me with this?</p>
  
  <p>Thanks.</p>