<?PHP$html = $_POST['html'];// uppercase headings$HTML = preg_replace_callback('(<h([1-6])>(.*?)</h\1>)',function ($m) { return "<h$m[1]>" . strtoupper($m[2]) . "</h$m[1]>"; },$HTML);
来源: http://www.webhek.com/post/pcre-pattern-modifiers.html