The quote in a quote.
Posted: Fri Jan 13, 2006 10:19 pm
Howdy doody. Simple question, but I don't know how the answer goes...
My current PHP regex is
and that formats to
Or put more simply,
Will format to
So basically it takes the persons name set inside the [quote=MyName] tag, and puts brackets around it, then it indents the main text.
My problem is that when I have two of these such tags embedded in each other, it produces some... er... odd, but expected results. For example:
I want this to come up with 2 quote blocks, but in actuality it will format to
As you can see, the "quotee" is not just the name of the person that was specified, but everything up to the end of the embedded quote.
So I guess my question is, how do I get the php regex to search from the outside in, so it will properly process the same tag types embedded?
Thanks
--Vector
<edit> You can view the undesired effect Here
My current PHP regex is
Code: Select all
'/\[quote=(.*)\](.*?)\[\/quote\]/is'Code: Select all
"Quote ($1):<br /><br /><div style='margin:2px 20px;border-style:hidden solid;border-width:2px;padding:2px 15px;'>$2</div>"Code: Select all
[quote=bob]Hello everyone![/quote]Code: Select all
Quote (bob) :
Hello everyone!My problem is that when I have two of these such tags embedded in each other, it produces some... er... odd, but expected results. For example:
Code: Select all
This is the main post
[QUOTE=PersonA]
[QUOTE=PersonB]
This is the embedded quote
[/QUOTE]
This is the first-level quote
[/QUOTE]
This is the main postCode: Select all
This is the main post
Quote (PersonA][QUOTE=PersonB]This is the embedded quote[/QUOTE]) :
This is the first level quote
This is the main postSo I guess my question is, how do I get the php regex to search from the outside in, so it will properly process the same tag types embedded?
Thanks
--Vector
<edit> You can view the undesired effect Here