<?php $str=" <b>test</b> <pre> <b>test</b> </pre> <b>test</b> "; echo preg_replace_callback(htmlspecialchars('~(?s)<pre>.*?</pre>~'), function($match) { return htmlspecialchars_decode($match[0]);}, preg_replace('~<(/?)b>~','[$1b]', preg_replace_callback('~(?s)<pre>.*?</pre>~', function($match) { return htmlspecialchars($match[0]);}, $str)));
You have javascript disabled. You will not be able to edit any code.