$mode1 = "/(\[b\])(.*)(\[\/b\])/U"; $replacement = "\\2"; $string = "this is [b]PHP4[/b],this is [b]PHP5[/b]"; echo preg_replace($mode1, $replacement, $string);?>注意:反向引用的时候是2个://