Thanks a lot, but do you know how to do the same with ereg_replace? I'm trying to learn PCRE, but until I do, I won't be able to add anything to this...

Jason Wong wrote:

It's not working because it's doing a greedy match. Try (I prefer the PCRE functions over EREG):

$text = preg_replace("/\[i\](.*)\[\/i\]/U", "<i>$1</i>", $text);

--
The above message is encrypted with double rot13 encoding.  Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law.




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to