in reply to Remove text formatting from raw irc socket data?
The heart is character 3. mIRC uses "\{03}$f" and "\{03}$f,$b" for colours, where "$f" and "$b" are numbers from 0 to 15. Given the lack of a terminator, the best you can do is:
$filename =~ s/\03(?:1[0-5]|[0-9])(?:,(?:1[0-5]|[0-9]))?//g;
I don't know how mIRC handles leading 0s, or numbers greater than 15, so there may be discrepencies. There are problems in the design of the colour code (it uses neither fixed-length fields nor a terminator), so you may still have problems with filenames starting with digits. There's no way around that.
Apparently, other clients use similar but incompatible codes for colours.
|
|---|