Also... this next alias should work with a much quicker regsub but I am missing something somewhere... I think the match text () are somehow wrong. Alias should remove double colors to the same colors. Excluding the special case of backgrounds. 256 sets would suck.
alias rdc {
var %i = $regex($1,/00[^]*(00)|01[^]*(01)|02[^]*(02)|03[^]*(03)|04[^]*(04)|05[^]*(05)|06[^]*(06)|07[^]*(07)|08[^]*(08)|09[^]*(09)|10[^]*(10)|11[^]*(11)|12[^]*(12)|13[^]*(13)|14[^]*(14)|15[^]*(15)/g), %rt = $1
while (%i >= 1) {
%rt = $left(%rt, $calc($regml(%i).pos - 1)) $+ $right(%rt, $calc(($regml(%i).pos + 2) * -1))
dec %i
}
return %rt
}