Quote:
Originally Posted by 007
I'd like to remove quoted text from thread previews.
Basically I want to remove anything that is either [ quote=xxxx ]text here[ /quote ] or [ quote ]text here[ /quote ] (without spaces in the quote tags obviously).
I'm not the greatest with regular expressions however and can't seem to figure out what to do here. My attempt was:
PHP Code:
$text = preg_replace("/\[quote(.*)\[/quote\]/", "", text);
Which did not work. Can anybody offer the correct regular expression? Thanks in advance!
|
I haven't tried it, but in the pattern you have you used / as the delimiter and there's a / in the pattern you're trying to match, so maybe choose another character for the delimiter.
ETA: like this:
PHP Code:
$text = preg_replace("#\[quote(.*)\[/quote\]#", "", text);