Wymyslilem sobie taka funkcje kolorujaca mi nicki z quake. Dziala dobrze, ale pod warunkiem, z enie zaczniemy uzywac roznych znakow typu @.
Dla przykladu ^4camikazee jest caly niebieski a ^4[L^7@^4$^7T]^3*^4C@^7M!^4K@^7ZE^3* dwa pierwsze koloruje reszty nie, dopiero od gwiazdki smile.gif Jak ktos sie bardziej zna na wyrazeniach regularnych, moze mi pomoze.
Kod
function color_tag($tag)
    {
    $str=ereg_replace("\^0(.*)", "<font color=#000000>\\1</font>", $tag);
    $str=ereg_replace("\^1(.*)", "<font color=#FF0000>\\1</font>", $str);
    $str=ereg_replace("\^2(.*)", "<font color=#00FF00>\\1</font>", $str);
    $str=ereg_replace("\^3(.*)", "<font color=#FFFF00>\\1</font>", $str);
    $str=ereg_replace("\^4(.*)", "<font color=#0000FF>\\1</font>", $str);
    $str=ereg_replace("\^5(.*)", "<font color=#FF00FF>\\1</font>", $str);
    $str=ereg_replace("\^6(.*)", "<font color=#00FFFF>\\1</font>", $str);
    $str=ereg_replace("\^7(.*)", "<font color=#FFFFFF>\\1</font>", $str);
    return $str;
    }