Given a wikiText string such as:
{{ValueDescription
|key=highway
|value=secondary
|image=Image:Meyenburg-L134.jpg
|description=A highway linking large towns.
|onNode=no
|onWay=yes
|onArea=no
|combination=
* {{Tag|name}}
* {{Tag|ref}}
|implies=
* {{Tag|motorcar||yes}}
}}
I'd like to parse templates ValueDescription
and Tag
in Java/Groovy.
I tried with with regex /\{\{\s*Tag(.+)\}\}/
and it's fine (it returns |name
|ref
and |motorcar||yes
), but
/\{\{\s*ValueDescription(.+)\}\}/
doesn't work (it should return all the text above).
The expected output
Is there a way to skip nested templates in the regex?
Ideally I would rather use a simple wikiText 2 xml tool, but I couldn't find anything like that.
Thanks! Mulone