title: PHP regex not working - returns NULL on local server, but works properly on other
body: <p>I have following regex:</p>
  
  <pre><code>/\{\s?joomla-tag\s+(.*&lt;+.+&gt;+.*)\s?\}/is
  </code></pre>
  
  <p>and the following code:</p>
  
  <pre><code>$regex = "/\{\s?joomla-tag\s+(.*&lt;+.+&gt;+.*)\s?\}/is";
  $replace = '&lt;div class="someclass"&gt;$1&lt;/div&gt;';
  $text = preg_replace( $regex, $replace, $text );
  </code></pre>
  
  <p>But, unfortunately, it cannot match the following code (nevertheless it should):</p>
  
  <pre><code>.... many html lines .......
  &lt;p&gt;123{joomla-tag Lore&lt;strong&gt;m&lt;/strong&gt; ip&lt;/p&gt;
  &lt;p&gt;sum dolor sit amet}&lt;/p&gt;
  .... many html lines .......
  </code></pre>
  
  <p><strong>See the real sample:</strong> <a href="http://pastebin.com/WSQyrmxd" rel="nofollow">http://pastebin.com/WSQyrmxd</a></p>
  
  <p>What's wrong: regular expression or something else? Could you please advise the correct variant?
  In RegExr, everything works smoothly, but not in PHP.</p>
  
  <p><strong>On a local server, i simply get NULL after preg_replace</strong></p>
  
  <hr>
  
  <p><strong>EDIT:</strong> 
  Finally I found a solution: (thanks, <strong>sg3s</strong>, for an idea)
  <a href="http://www.pelagodesign.com/blog/2008/01/25/wtf-preg_replace-returns-null/" rel="nofollow">http://www.pelagodesign.com/blog/2008/01/25/wtf-preg_replace-returns-null/</a></p>