IRC-module issues with colored numbers

Got one problem.
Colored text containing numbers *only* is not shown by IRC-gate.
Looks like gate gets string, e.g., "\0030706\003" (that's orange "06"), sees \003 and thinks "Oh, color", but then instead of getting "07" as color it gets "0706", thus resulting in loss of text :)

Quote:

mod_irc_connection.erl:

Quote:

filter_mirc_colors(Msg) ->
case regexp:gsub(Msg, "(\\003[0-9]+)(,[0-9]+)?", "") of
{ok, Msg2, _} -> Msg2;
_ -> Msg
end.

And maybe some other places?

As far as I understtod,

Quote:

case regexp:gsub(Msg, "(\\003[0-9]+)(,[0-9]+)?", "") of

at least should be replaced with

Quote:

case regexp:gsub(Msg, "(\\003[0-9]{1,2})(,[0-9]{1,2})?", "") of

But in fact there must be regexp that gets numbers from 0 to 15, while my regexp gets from 0 to 99 :(

You can try the

You can try the code mod_irc_connection.erl

Quote:

filter_mirc_colors(Msg) ->
case regexp:gsub(Msg, "(\\003[0-9]{1,2})(,[0-9][0-9])?", "") of
{ok, Msg2, _} -> Msg2;
_ -> Msg
end.

[0-9]{1,2} should be

[0-9]{1,2} should be replaced with ([0-9]|1[0-5]).

Syndicate content