ich probiere nun schon ewig an einer Funktion, aber komme leider nicht weiter. (langsam überkommt mich das Gefühl das ich wahrscheinlich einfach den falschen Ansatz habe

ich habe einen text in der variable text, innerhalb des Textes kommen mehrere Textgruppen vor <gallery> image:bla image:bla <gallery>. nun möchte ich mit der Funktion diese Gruppen finden und jeweils als image innerhalb der <gallery> Gruppierung umwandeln... hier was ich bis jetzt hab und ein bsp. Text.
TEXT:
Meine Funktion:== [[HLinear Electrical Network Domaineadline text]] ==
bla blubb
<gallery>
Image:Button_sup_letter.png
Image:Help.png
Image:Sca_c.gif
</gallery>
== Headline text ==
The Wiki uses a subset of '''TeX markup''', including some extensions from LaTeX and AMSLaTeX, for mathematical formulae. It generates either PNG images or simple HTML markup, depending on the complexity of the expression.
<math>x+y=34</math>
<math>cv+78=zt</math>
=Test3=
[[Image:Example.jpg]]3ze^^^^^923b91^2 lsdjfnaöoru qo
Code: Alles auswählen
def doGallery(text):
match = re.findall(r'\<\gallery\>(.*?)\<\gallery\>', text)
for gal in match:
print gal
return match

Evtl. hat jemand auch eine Idee für einen alternativen Ansatz? Bin für alles offen...
Danke für Tipps und eure Hilfe