You can use the $strip identifier. It has a second param which denotes which kind of codes you want to ignore.
$strip(text,burcmo)
Returns text with all bold, underline, reverse, and color control codes stripped out.
The m applies the strip settings in the Messages dialog, and the o applies the "only if..." settings in the messages dialog.
Easiest way for you will be: $strip($5)