I am not sure if you can force the system to accept markup in the category titles, and I am not sure you should even try so I am going to suggest that you hack together a kind of markdown. Use some character like
* as a placeholder then...
$pattern = '|(\*)([^\*]+)(\*)|';
I am not sure how robust that is. I am sure the callback could be much better but it works when I test it.
Also, a lot depends on how you are displaying the categories. I am not even sure if that is the filter you need. Your questions does not provide that information.