I run a Drupal 7 website with Forum, Blog, Comment core modules enabled and a custom module (generates a block with Flash game and blocks with player rating) written by me.
The website is dedicated to a Russian card game and users often mention card colors in their comments when discussing some card riddle or a game:
Most users are older folks, who don't understand anything like HTML tags, so I have only enabled plain text comments for them.
My quesion is: in the plain text Comments - how to recognize the strings like K♥ or 7♦ and color them red?
The PHP code would be something like:
preg_replace(/(1?[0789JQKA][♥♦])/, '<font color="red">\1</font>', $str);
(I can improve the regex later) - but where/how to apply it in Drupal 7?