$string = preg_replace('/m.{0,2}(y|i).{0,2}(s|z|5|$).{0,2}p.{0,2}(a|@).{0,2}c.{0,2}e/i', '....', $string);
this works great except around B[/B] the $ does not work, any ideas how to make it work?
Escape it... (s|z|5|\$)
The reason being is that the $ is a special character in regexp's.