A posto dopo ore di prove ho tirato il ragno dal buco!

Per tutti quelli che lo volessero sapere questo è il codice da usare:

Codice PHP:
<?
include_once 'geshi.php';

function 
geshiParse($matches){    
    
$geshi = new GeSHi($matches[2], $matches[1]);    
    return 
'<div class="codice">'.$geshi->parse_code().'</div>';    
}

$regex "#\[code=(.*?)\](.*?)\[/code\]#s";

$text="PHP code:
[code=php]<?PHP \n    \$variable = 'variable'; \n?>[/code]Codice AS3[code=actionscript3]var variable = 'variable';\nstop();[/code]End."
;
$text preg_replace_callback($regex'geshiParse'$text);
echo 
$text;
?>
La classe "codice" va impostata nel css a piacere ma non è necessaria.