I have to replace text this way:
Some data la-la-la [image=test.png] next data...
Some data la-la-la 123 [image=test2.png]
And replace that with:
Some data la-la-la test.png next data...
Some data la-la-la 123 test2.png
I tried with re.sub method from python:
for foo in re.search('(\[image=(.*)\])', text):
text = re.sub("(?<=\[image=)*(?=\])", foo, text)
But that won't work, why?