You could use css.
<head>
<style type='text/css'>
b { color:red; }
</style>
</head>
//Other code
<b>abc</b>
Other idea is in the php code. Have you tried to do this?:
<?php
$string = 'asdfasdfa<b style="color:red">asd</b> asdfasdf';
$string2 = str_replace('<b style', '<bstyle', $string);
//And then do the search
$search = strpos($string2, " ", 0);
?>