If I have the following string:
s = 'sdsdsdBetreft:ddddddBetreft:HOOOIIIIgagaga'
How do I get the HOOOIIII
?
I tried the following:
p = re.search(r'Betreft:(.*?)gagaga', s).group(1)
print(p)
But that gives me:
ddddddBetreft:HOOOIIII
This is because 'Betreft' occurs multiple times. I'm lost.
Any tips?