我需要从一组文本信息中提取 http 链接。具有图像扩展名的特定短语(.jpg,.png)
比如我要一个人“ http://www.mywedding.com/blog/wp-content/gallery/p_867/bridal-party-white-flowers-40306.jpg ”
从下面的一组东西
<p><a href="http://www.mywedding.com/blog/wp-content/gallery/p_867/bridal-party-white-flowers-40306.jpg" target="_blank"><a href="http://www.mywedding.com/blog/wp-content/gallery/p_867/bridal-party-white-flowers-40306.jpg">http://www.mywedding.com/blog/wp-content/gallery/p_867/bridal-party-white-flowers-40306.jpg</a></a> (from <a href="http://cameroningalls.com/emily-meeko-tiburon/" target="_blank">this wedding by Cameron Ingalls</a>)</p>
如果这些是 img 标签,我可以从简单的方法中得到它
String s="<img src="https://i.stack.imgur.com/SUSRH.jpg"/>
s=s.replace("<img src=", "");
s=s.replace("/>", "");
但是我很困惑第一个场景,有什么建议吗?