I'm using PEAR Text_Wiki http://pear.php.net/package/Text_Wiki to convert Wiki Syntax to HTML.
I tried to expand the List Feature to be able to have list-types and starting values.
To make a numbered list you write something like:
Code: Select all
# Ex 1
# Ex 2
# Ex 2.1
# Ex 3
Normal Text
# Next List 1
# Next List 2
Code: Select all
/^((\*|#) .*\n)(?!\2 |(?: {1,}((?:\*|#) |\n)))/UsmI want to realize a list like this:
Code: Select all
# Ex 1
# Ex 1.1
#i Ex 1.i
# Ex 1.ii
#A Ex 1.ii.A
# Ex 1.ii.A.1
# Ex 1.ii.A.2
# Ex 1.ii.B
# Ex 2
----
#i Ex i
# Ex ii
#a Ex 2.a
# Ex iii
----
#=2 Ex 1 Value 2
#=2 Ex 2 Value 2
----
#i=2 Ex i Value 2
#i=9 Ex i Value 9
----
For this I "upgraded" the regex like this:
Code: Select all
/^((\*[1aAiI]?[=]?[0-9]*|#[1aAiI]?[=]?[0-9]*) .*\n)(?!\2 |(?: {1,}((?:\*[1aAiI]?[=]?[0-9]*|#[1aAiI]?[=]?[0-9]*) |\n)))/UsmThe third example works but the last one is devided into two seperate lists.
I guess this is something about the negative lookahead, but i can't get it working.
I would be pleased, if someone could help me.
Greetings