I want to remove all quotes from a string INCLUDE nested quotes.
it does not works for nested qoutes:
preg_replace("/\[quote(.*?)\](.*?)\[\/quote\]/i","", $text);
this works for something like:
[quote=admin]Welcome to RegExr 0.3b, an intuitive tool for learning, writing, and testing Regular Expressions. Key features include: [/quote]
but not for:
[quote=admin]Welcome to RegExr 0.3b, [quote] an intuitive tool for learning, [/quote] writing, and testing Regular Expressions. Key features include: [/quote]
would like to remove all qoute blocks
I think your mistake simply is the question mark in your expression.
Try
preg_replace("/\[quote(.*?)\](.*)\[\/quote\]/i","", $text);With your example posted in your edit: