I would just put all of the $replacex stuff into one command rather than multiple IFs and $replacex's.
if([ isin %mud.info) { %mud.info = $replacex(%mud.info,code1,$ctrl,code2,$ctrl,code3,$ctrl,etc,etc) }
Of course, you can also do that without the IF.
Was thinking something similar, but the code you use is the start of a standard ANSI escape code, so all that would do is strip all of them, including the color ones. What I have noticed is that it's always control code number;number and f, maybe that is the key
