I have the below text but want the quote bit removed from the string, I'm using the below regex but it gives me the below error.
Text Example 1
<p>[quote]</p>
<p>[quote]</p>
<p>inner quote text</p>
<p>[/quote]</p>
<p>outer quote text</p>
<p>[/quote]</p>
<p>This is a test.</p>
Text Example 2
<p>[quote][quote]</p>
<p>inner quote text</p>
<p>[/quote]</p>
<p>outer quote text</p>
<p>[/quote]</p>
<p>This is a test.</p>
Expected Text
<p>This is a test.</p>
Regex
preg_replace('/<p>\[quote\][\s\S]+?<p>\[\/quote\]<\/p>/', '', $string);
Error
Warning: preg_replace(): Compilation failed: missing terminating ] for character class at offset
I've had a look at Deleting text between two strings in php using preg_replace which has helped but I haven't been able to figure it out, any help greatly appreciated.
[in ...\<p\>[...2.) your sample text contains[quoteand not[quote]. Further there is no need to escape<,>