Say if this is my total contents

Code:
<a href="example.php">result</a>
<a href="example.php">result</a>
<a href="example.php">result</a>
How would i go about saying
$link = ( pregmatcheverything in between href=" and ")
and $name = (preg match everything after $link and </a>)

I will give anyone thanks who helps me with this.

then echo all of the preg matched (both $link and $name) on the page.