If "b%d" is supposed to be ">", you have a missing a "b%d" sequence after the font tag.
If your HTML was valid, I would suggest this:
$search = array('r%#d', 'b*%d', '#i#j#');
$replace = array('<', '>', '');
$data = str_replace($search, $replace, $data);
simply because there'd be no need for using regular expression.