PDA

View Full Version : Help with regular expression needed.


RagingPenguin
05-08-2008, 05:14 AM
How would I change this so that it also catches both of the following quote types?

$pagetext = preg_replace('#\(.*?)\[/quote\]#si', '', $pagetext);


[quote]anything at all
anything at all


Man I hate regex. I just don't understand it at all. =/

Dismounted
05-08-2008, 05:51 AM
I think you are looking for this: ;)
// ################################################## ###########################
/**
* Strips away [quote] tags and their contents from the specified string
*
* @param string Text to be stripped of quote tags
*
* @return string
*/
function strip_quotes($text)