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