preg_match_all for magnet link
<p>I want to use preg_match_all to get magnet links from threads then use the first magnet link.</p>

<p>I tried many patterns but nothing worked.</p>

<pre><code>$uris = array();
preg_match_all('\'http://magnet:?\'', $post, $uris);
foreach ($uris[0] as $href) {
//////////////////////////////
$magnetUri = $href;
break;
}
</code></pre>

<p>the <code>$post</code> is in bbcode , so i used the pattern for URL but this will get any url not magnet</p>

<p>Any idea?</p>

<p>Thanks in advance</p>
