Mam takie oto wyrażenie:
$post = preg_replace("#\[COLOR=rgb\((.*)\)\]#", "[color=\#" . $this->rgb2hex($1) . " . "\"]", $post);
Niestety wygląda na to że nie mogę użyć $1 odwołując się do funkcji rgb2hex, może mi ktoś jakoś pomóc to naprawić?

$post = preg_replace("#\[COLOR=rgb\((.*)\)\]#", "[color=\#" . $this->rgb2hex($1) . " . "\"]", $post);
create_function( '$matches', 'return "[color=#{$this->rgb2hex($matches[1])}]";' ), $post);
create_function( '$matches', 'return "[color=#{$this->rgb2hex($matches[1])}]";' ), $post);