How would I use preg_replace in this situation?
I have an html file similar to this:
<div class="body">
<a href="somelink.html">Some Link</a><br>
This is some text<br>
</div>
<br>
<div class="body">
<a href="anotherlink.html">Another Link</a><br>
Here is some more text.<br>
</div>
I want to extract the links so I end up with this....
<a href="somelink.html">Some Link</a><br>
<a href="anotherlink.html">Another Link</a><br>
I cannot figure out what pattern I should be searching for. Any help would be greatly appreciated.