Possible … probably. Easy … not so much. But I think that’s the approach Mohammad uses in refnotes to extract references. But in that case, we ended up using a JS macro I wrote. Sadly, TW still lacks the tools you need to easily extract patterns. It has bits and pieces that kind of approach one end or the other end of the problem, but doesn’t give you a one-stop solution. So you end up with long, complicated filter runs.
The current extractor only extracts images with the jpg extension. It would need some more work for other file extensions.
If you’re serious about extracting images, and don’t mind using 3rd party tools, then adding the regexps tool from this sad little PR might simplify things: