This question is supplementary to: Recursive processing of markup using Regular Expression and DOMDocument
The code supplied by the selected answer has been a great help to understand building a basic syntax tree. However I am now having troubles tightening the regular expressions to only match my syntax rather than {.
but not {{
. Ideally I would like it to only match my syntax which is:
{<anchor>}
{!image!}
{*strong*}
{/emphasis/}
{|code|}
{-strikethrough-}
{>small<}
Two tags, a
and small
also require differing end tags. I have tried modifying $re_closetag
from the original code sample to reflect this but it still matches too much as text.
For example:
http://www.google.com/>} bang
smäll<} boom
My test string is:
tëstïng {{ 汉字/漢字 }} testing {<http://www.google.com/>} bang {>smäll<} boom {* strông{/ ëmphäsïs {- strïkë {| côdë |} -} /} *} {*wôw*} 1, 2, 3