Another Regular expression question (extract link)

hi all, I am again here with more regex questions and need help as usual :slight_smile:

I am trying to find a link something like blah.com regardless of its http://www given or not, so my code will find out the url “blah.com” and its anchor text as well.

Now this will be in any class e.g.

<div class=“myClass”>
<a href=“blah.com”>This is Blah</a>
<p>there is some text</p>
</div>

so I will only give the URL and it will display me something like this

blah.com = This is Blah = there is some text

I need some help here :slight_smile: thank you for your time.

Something like this shouldn’t be done through regex, I would suggest with reading here :wink: :
http://www.php.net/manual/en/book.dom.php