I'm trying to find a substring of a string s, starting with {{Infobox
and ending with }}
. I tried doing this with a regular expression, but it doesn't get any results. I think the fault is in my regular expression, but since I'm quitte new to regex, I hope someone can help with this. String s is for example:
s = '{{blabla}}{{Infobox persoon Tweede Wereldoorlog| naam=Albert Speer| afbeelding=Albert Speer Neurenberg.JPG}}{{blabla}}'
result = re.search('(.*)\{\{Infobox (.*)\}\}(.*)', s)
if result:
print(result.group(2))