I'd use ungreedy matching here, else everything from the first opening to the last closing tag will get bold in case there are more than one pair of tags. and don't forget to escape the slash in the pattern, or use different delimiters.
$str = preg_replace('# b [ /b ]#i', '< b >$1< /b >', $str);