Nested bbCode
Posted: Thu Jun 14, 2007 3:48 pm
I created a nice little bbCode pattern that I'm using to make my blog writing simpler and enable the ability for me to make some patterns for parsing my code, but I've run into a problem.
Nested tags.
Any tags within other tags are completely ignored. I could run the preg_match_all on the results also, but that seems... unorthodox to me. Does anyone know how this would be accomplished, or is that the only way?
By the way, in case anyone's interested, here's the regex pattern thus far:
Nested tags.
Any tags within other tags are completely ignored. I could run the preg_match_all on the results also, but that seems... unorthodox to me. Does anyone know how this would be accomplished, or is that the only way?
By the way, in case anyone's interested, here's the regex pattern thus far:
Code: Select all
(\[([\w]+)(=([\w]+))?\])(.*?)(\[\/\2\])