我有一段看起来像这样:
First.Check out this <a href="https://sample.com/applications/Documents/SolutionContingency.html" target="_blank">demo </a>to learn about the Solution Contingency feature of MME.
Second Paragraph. Get your head out of the fog and use the solution contingency feature in MME! All the costs for a WMU are displayed on the Costs screen in the Forecast menu.
<a href="https://blog.sample.com/mme/files/2013/07/SC2.jpg"><img title="SC2" alt="" src="https://blog.sample.com/mme/files/2013/07/SC2.jpg" width="1262" height="711" /></a>
Fourth.You should review your solution contingency at least once a month.
我刚刚使用正则表达式将图像网址替换为空字符串,使用以下方法:
(<a.*?<img.*?>.*?/a>|<img.*?>)
您知道为什么从超链接到图片的输出被切断了吗?它只显示第一和第四段。
这是输出:
First.Check out this Fourth.You should review your solution contingency at least once a month.
当段落没有超链接时,删除图片效果很好。