I’m not sure that can be done with find&replace if the two may appear in an arbitrary order. You may have more luck exporting to a csv file, solving the problem with external tools/chatGPT, then importing your changes back in.
If done in multiple steps, maybe it will work. You could remove divs, then text, then links, etc. using separate regex expressions first (such as </?a[^<>]+>). In the end only images will be left.
I gave a bad example. there are multiple <img> tags. so it’s more like:
asdlfkaj sdfl<img>adslfkaj <img>aldkjf aldfj
@dae was correct. can’t be done b/c anki uses rust regex, but doesn’t support lookbehind.
this particular problem has to be solved externally. excel’s formulas and sublime’s find/replace each had some kind of limiting feature. I ran out of time, but found a way to get the major problem I was trying to solve fixed. I’m sure a more typical regex with python would solve the img tag problem.