Simone: preg_match kleines Problem

Beitrag lesen

Hi
Ich hab ein Problem:
Ist bestimmt nicht so schwer zu lösen  aber ich bekomm's einfach nicht hin.
Also ich möchte aus $conttestfil nur den "suchfad" isolieren
Dateiname(wort) "logfile" bleibt immer gleich

$conttestfil= "c:\programme\apache group\apache\htdocs\opti\dateimanger\hauptfad\suchfad\logfile1.rww_";

Mein Lösungsansatz:

$mask = str_replace("\", "#", $conttestfil);
  if (preg_match('/#([^"]+)#logfile/i', $mask,$suchwort))
              $suchw .=$suchwort[1];
              $suchw = str_replace("#", " ", $suchw);
              echo " $suchw";

Simone