After playing around with it a bit I came up with the following to start.
PHP Code:
<?php
$string ="hi, how goes it this is [quote]Bill[quote]Bill meyer[/quote] meyer[/quote] meyer";
$stringo = preg_replace('/\[quote\](?!.*?\[quote\]).*?\[\/quote\]/is', "XXXXXX", $string);
print $stringo;
echo"<br>$string";
?>
EDIT: Grr, I messed up somewhere. Just a sec.
EDIT: kk, fixed.
loop the string with the above PCRE the number of times that there are nested "quotes text /quotes" and your string will be modified appropriately. This is, of course, silly since str_replace will do the same thing faster and is easier on your server, but it is good to work on these things to stay in practice.
Bookmarks