001
22.10.2004, 09:25 Uhr
FloSoft
Medialer Over-Flow (Administrator)
|
mit deinem ausdruck würdest du nur "leere" tags erfassen. Was du ja willst ist der Text dazwischen, also so:
PHP 4: |
preg_match("/\[b\](.*)\[\/b\]/", $content, $res);
|
im boardparser schaut das ganze so aus:
PHP 4: |
$string = preg_replace("/\[b\](.*)(\[\/b\])/Us", "<b>\\1</b>", $string);
|
für Us hier der Auszug aus PHP-Manual:
Zitat: |
U (PCRE_UNGREEDY) This modifier inverts the "greediness" of the quantifiers so that they are not greedy by default, but become greedy if followed by "?". It is not compatible with Perl. It can also be set by a (?U) modifier setting within the pattern.
s (PCRE_DOTALL) If this modifier is set, a dot metacharacter in the pattern matches all characters, including newlines. Without it, newlines are excluded. This modifier is equivalent to Perl's /s modifier. A negative class such as [^a] always matches a newline character, independent of the setting of this modifier.
|
-- class God : public ChuckNorris { }; |