My Code
preg_match_all('/\{([\w]+)(\s.*)?[^\}]\}(.*)\{\/\w+[^\}]\}/', $nbody, $matches );
My Template
rtrim: Beginning Text{rtrim} String {/rtrim}Surrounding Text
camelize: {camelize}Camelize Some Text Like A MediaWiki Title{/camelize}
Date Modifiers
date: {date format="M/d/Y"}June 14th 1965{/date}
iso date: {date format="c"}1310036802{/date}
timestamp date: {date format="c"}June 14th 1965{/date}
time: {time}{/time}
I am trying to get my regex to work so that I can capture the attributes as seen with the {date format=””} example. With the above pattern I’m 99% of the way there but it eats the last character of {tags} without attributes.
...
[11] => rtri
[12] => cameliz
[13] => date
[14] => date
...
As well as the last ” of the attribute matches
...
[13] => format="M/d/Y
[14] => format="c
[15] => format="c
...
Any help would be appreciated!
this expr would probably fit better