Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
Thread: preg_replace problems (again)
06-20-2006, 04:12 AM #1
preg_replace problems (again)
I'm trying to create the equivalent of [noparse][/noparse] for my site.
But everything I try, only works a little bit, or not at all.
here's what I got now:
$newtext = preg_replace("|\[(.*?)\]|i","[*$1]",$tstring);
$text = "this is a test thread!
this shouldn't parse.. at all
[color=green]this would be green![/color]
this should be seen
[color=yellow]this would be yellow![/color]
[color=blue]this should be blue![/color]";
//strip out noparse tags and process tags within
$text = preg_replace("(\[noparse\](.*?)\[\/noparse\])i",doNoParse("$1"),$text);
//echo the finished product