hello,
i've written a php-bb-parser that uses the 'preg_replace_callback' function.
bb-code looks like this:
[tag=opt. attrib]value[/tag]
for example:
bold , or label
my regex looks like this:
#\[(.+)=?(.*?)?\](.*?)\[\/\1\]#
the callback function will then process the backreferences and create html. the function is called until the string I have before 'preg_replace_callback' is similar to the one after I called the function, so that it will process multiple/nested tags correctly.
it does work fine for the two examples I gave above. It also works for nested tags like bold+italic
now I'm trying to implement an (un)ordered list; the syntax shall look as following:
[ul]
item0[/li]
item1[/li]
...[/li]
[/ul]
the problem is that it will parse the li-tags correctly but leave out the ul-tag.
I've already tried the posix mods 's', 'x', 'm'
I'm looking forward to your replies, thank you in advance.
edith says: this board uses BB-Code too, what a mess.