If this is the only way they can be nested, you can use scanner states, that is, define a scanner
state 'outside template', which matches {{ only. when encountering {{, switch to a 'inside template'
scanner state which matches {{{ only. When encountering }}, switch back to the 'outside template'
scanner state.
An alternative solution would be to use a scannerless parser. I am however not sure whether these
exist for Python.
Sincerely,
Albert
Also, have you investigated the tools listed on this page?
http://www.mediawiki.org/wiki/Alternative_parsers
There are several Python solutions listed.
--
-Brian
Brian Clapper, http://www.clapper.org/bmc/
Weiler's Law:
Nothing is impossible for the man who doesn't have to do it himself.
[...] have you investigated the tools listed on this page?
http://www.mediawiki.org/wiki/Alternative_parsers
There are several Python solutions listed.