help with preg_replace()
| From: | Gregor Jak�a | Date: | Mon, 01 Jul 2002 11:50:31 +0000 |
| Subject: | help with preg_replace() | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-104647@lists.php.net to get a copy of this message | ||
ive been tryin to find a solution for this problem for some hours now, but i
just dont know how to do it... so i ask for ur assistance. Lemme list some
examples, so u can see what im tryin to do :)
"word" = "word"
>word = >| word |
<word = <| word |
>"word = >|word |
<word" = <| word|
So if pattern is "word" it should stay "word", if patter is >"word it
should
replace it with >|word | and so on as u see from examples... any help or
hints would be helpfull...
thats what i have now: preg_replace("#^[<|>]?[^\"](.*?)[^\"]$#i", "|
\\0 |",
$string); .. but it doesnt work :P
thx in advance !