Thank you CA for this wonderful and amazing piece of code.
I've played around and tried to understand the way it works, and now I'm running this code on a test board with some added BBCode.
I want to point out that this code is not only faster that the standard parsing, but is also more secure, because it has less security issue than the standard BBCode (I've played with some script to test it).
Last, but not least, I've noticed that most of the speed in ViewTopic is due to the $compiled_message
which stores in the DB a fully formatted post so it has not to be compiled (parsed) again. This speed up tremendously the viewing of heavy formatted messages.
Again, CA I think you're one of the best coder around the web.
Thank you for all.