Your regex only match anchor elements, not image elements. You should either use more regexes (ugh), or make your current regex more flexible (ugh).
There is a sneaky workaround that abuses the code used by Swing to render HTML in editor panes. Class HTMLEditorKit.Parser
can be used to perform (basic) HTML parsing for you (although it's limited to HTML 3.2...).
To use this, create an instance of ParserDelegator
, implement a ParserCallback, and call the parse method. The trick is in writing the ParserCallback - the handleSimpleTag and handleStartTag give you access to the elements and their attributes. You should at least check for attributes HTML.Attribute.HREF and HTML.Attribute.SRC.
(If you want to have better HTML parsing support, you can use DocumentParser
instead, if you can create a correct DTD instance.)