mIRC Homepage
Posted By: Quia Stripping specific colour codes - 02/10/07 05:14 AM
I've been trying to remove ctr+k#,# colour codes without changing ctr+k# codes, but I can't figure out how to do it. One problem being that I need to detect ##,## ##,# #,## and #,# to catch all of them, so I can't just $remove the first 4 characters, and I'd also like to remove it no matter where in the string it is.

Any ideas?
Posted By: Lpfix5 Re: Stripping specific colour codes - 02/10/07 06:17 AM
//echo -a $strip(My colored string,c) will strip all colors out of string

while $remove($1-,$+($chr(3),##)) will also do the same
Posted By: LonDart Re: Stripping specific colour codes - 02/10/07 11:50 AM
It seems you only want to remove color codes that indicate a background color, and retain those that only color the text.

For that case, this worked in my limited testing:
Code:
alias nobkgd {
  $iif($isid,return,echo -a) $regsubex($1-,/\x03\d?\d\x2c\d?\d/g,$chr(32))
}

\xo3 is hex code 3, the only thing I tried that caught Ctrl+k.
Likewise, \x2c is hex code for comma. mirc doesn't like literal commas, even inside regex.
© mIRC Discussion Forums