Einzelnen Beitrag anzeigen

Benutzerbild von jfheins
jfheins

Registriert seit: 10. Jun 2004
Ort: Garching (TUM)
4.579 Beiträge
 
#12

Re: PCRE: Hilfe gesucht

  Alt 8. Jul 2005, 17:22
Ja, du hast es nötig

Bei folgendem Code:
Code:
<?

header ("Content-Type: text/plain");

$text = "blah blah
bla {FOO} bla2";

$text = preg_replace('##is', 'BAR', $text);

echo $text;

?>
Kommt das raus:
Zitat:
blah blah
bla {FOO} bla2
Und mit diesem (leicht abgeändertem) Code:
Code:
<?

header ("Content-Type: text/plain");

$text = "blah blah
bla {FOO} bla2";

$text = preg_replace('#[color=#ff0000](#is', 'BAR', $text);

echo $text;

?>
Kommt das raus:
Zitat:
blah <!-- IF BAR blah
bla {FOO} bla2
Alci will das aber so:
Zitat:
blah blah
bla BAR bla2
(Doppelt hält besser, nicht wahr alci ? )
  Mit Zitat antworten Zitat