在:
=={{int:filedesc}}==
{{Information
|description = wikiwoordenboek audio
|date =
|source =
|author =
|permission =
|other_versions =
}}
[[Category:Dutch pronunciation|Example]]
是否可以找到|
和]]
之间的任何内容,然后用它来替换" wikiwoordenboek audio"
后:
=={{int:filedesc}}==
{{Information
|description = Example
|date =
|source =
|author =
|permission =
|other_versions =
}}
[[Category:Dutch pronunciation|Example]]
答案 0 :(得分:0)
答案 1 :(得分:0)
>>> import mwparserfromhell
>>> t = """=={{int:filedesc}}==
... {{Information
... |description = wikiwoordenboek audio
... |date =
... |source =
... |author =
... |permission =
... |other_versions =
... }}
... [[Category:Dutch pronunciation|Example]]"""
>>> for i in mwparserfromhell.parse(t).filter_templates():
... if 'information' in i.name.lower():
... i.get('description').value = 'Example'
...
>>> t
u'{{Information\n|description =Example|date =\n|source =\n|author =\n|permission =\n|other_versions =\n}}'