我正在研究一个应用程序女巫从不同的网站获取其内容。在获得的内容中有时是内部链接。我需要将http://www.olddomain.com添加到这些链接的 href 值中,以确保它们仍然可以在我的应用程序中工作。
数据在一个变量中:文本
可变文本包含:
<p style="text-align: right;">
Lots of text in here, with all kind of html tags, <br /><br />
when suddenly a link appears:
<a href="/niceinternalpage.html">Here!</a>
</p>
我需要的输出:
<p style="text-align: right;">
Lots of text in here, with all kind of html tags, <br /><br />
when suddenly a link appears:
<a href="www.olddomain.com/niceinternalpage.html">Here!</a>
</p>
提前致谢!