Picco: regulärer ausdruck findet nichts

Beitrag lesen

hallo,
ich würde gerne einem a-tag in einer unbekannt Umgebung eine Klasse hinzufügen.

  
  
$aktiv =  'kontakt';  
  
$test = preg_replace( '!<a href="\.\/'.$aktiv.'\.php">(.*)</a>!','<a href="\.\/'.$aktiv.'\.php" class="aktiv">\\1</a>', 'foo <a href="./kontakt.php">Kontakt</a> baar');  
echo $test;

ergibt:
foo <a href="./kontakt.php">Kontakt</a> baar

anstatt
foo <a href="./kontakt.php" class="aktiv">Kontakt</a> baar

warum?