I am making plugin for forum that delete over-quoting, so that there are only one level quotes:
<quote>
<quote>subquote</quote>
quote111
</quote>
text
<quote>quote222</quote>
text
<quote>subquote</quote>
should be removed, because it is in another quote.
What is the best way to do it? I thought that this is widespread, but I cannot google it out.
It should be some crazy regexp. I can't wrap my head around this.