from a link that looks like this:
Code: Select all
<a href="http://www.somedomain.com/linktopage">[1]</a>it was very important to me it match all links with [1] within the <A>:
Code: Select all
#href://(.*?)">\[1\]</a>#Moderator: General Moderators
Code: Select all
<a href="http://www.somedomain.com/linktopage">[1]</a>Code: Select all
#href://(.*?)">\[1\]</a>#Code: Select all
#!/usr/bin/php
<?php
$text = '<a href="http://www.somedomain.com/linktopage">[1]</a>';
if(preg_match('#href="(.*?)">\[1\]</a>#', $text, $matches)) {
$url = $matches[1];
print "$url\n";
}
?>