This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

irc color on web page

Old posts that have not been replied to for several years.
Locked
o
openglx

Post by openglx »


Hi
I have a eggdrop 1.6.7 running a tcl that should get the /list, and other info from the server

my question is this : there's some way to transform the irc colors to web colors ?

or if there isn't a way, how to strip them ?

thanks all
B
Baerchen

Post by Baerchen »

Hi,

This tine little regsub will get rid of all colour codes including bold, underline and reverse codes in variable n:

regsub -all {|||(([0-9])?([0-9])?(,([0-9])?([0-9])?)?)?|([0-9A-F][0-9A-F])?} $n "" n

If you want to remove only the colour codes:

regsub -all {(([0-9])?([0-9])?(,([0-9])?([0-9])?)?)?|([0-9A-F][0-9A-F])?} $n "" n

Hope that helps. Greets,

Baerchen
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

Yuk - you should never use CTRL codes directly, as they can cause problems.

Alternaivly, you could use
regsub -all -- {03[0-9]{0,2}(,[0-9]{0,2})?|17|37|02|26} $n "" n
This is the same, but with CTRL codes stripped.

Baerchen:
What is the purpose of ([0-9A-F][0-9A-F])

I am guessing this is ansi encoded tags?
Locked