Not for 'how-to' coding questions but PHP theory instead, this forum is here for those of us who wish to learn about design aspects of programming with PHP.
What I mean by nonrecurisve is that I don't call another instance of the parser to handle the attributes. Some parts of this system would have to be recursive in order to make things more managable.
Well, there's block level tags like quote and inline level tags like bold. Split up processing for them, then you call just the inline processing when you have an attribute.