I'm dealing with a full html document, and I need to extract the urls but only if matches the required domain
<html>
<div id="" class="">junk
<a href="http://example.com/foo/bar">example.com</a>
morejunk
<a href="http://notexample.com/foo/bar">notexample.com</a>
</div>
</html>
from that junky part I would need to get the full url of example.com, but not the rest (notexample.com). that would be "http://example.com/foo/bar" or even better, only the last part of that url (bar) witch of course would be different each time.
Hope I've been clear enough, thanks a lot!
Edit: using php