I have been trying to fetch just the URL from the following string but unsuccessful. How can I do that, any tips?
$string='<b><u>Neale v Commonwealth
Bank of Australia</u></b><b>
[2014] NSWCA 443</b><br>
Court of Appeal of New South Wales<br>
Leeming JA<br>
Appeal - competency - bank was successful judgment creditor in proceedings brought by applicant and his company - bank sought that appeal be dismissed as incompetent or for want of prosecution - requirement that, if well-funded, sophisticated, regular litigant is to object to competency of appeal brought by litigant in person, objection should be made promptly - ability to fund appeal - held: bank had not explained why it did not
make prompt objection - extension of time to seek dismissal of proceedings as incompetent refused - appeal not self-evidently hopeless - severe prejudice ifapplicant denied right of appeal on merits of very substantial judgment - there
had been some explanation for delay and non-compliance with Court procedure -
no particular prejudice to bank - guillotine order made.<br>
<a rel="nofollow" target="_blank" href="http://www.caselaw.nsw.gov.au/action/PJUDG?jgmtid=176362">Neale</a> (B)<br>';
$url=preg_match('/(http:\/\/)(.*)/', $string, $link);
echo $link[0];
OUTPUT: http://www.caselaw.nsw.gov.au/action/PJUDG?jgmtid=176362">Neale (B)
The script is adding extra characters after the URL which shouldn't be there.