fork(1) download
  1. <?php
  2.  
  3. $re = '~\bhref=(["\'])(?!http://(?:www\.)*mysite\.com)(?<link>(?:(?!\1).)*)~i';
  4. $str = "<a href=\"http://w...content-available-to-author-only...e.com\">\n<a href=\"http://m...content-available-to-author-only...e.com\">\n<a href='http://m...content-available-to-author-only...e.com'>\n<a href='http://w...content-available-to-author-only...e.com'>\n<a href='http://w...content-available-to-author-only...e.com'>\n<a href='http://w...content-available-to-author-only...n.com/id.php?site=mysite.com'>";
  5. preg_match_all($re, $str, $matches);
  6. print_r($matches["link"]);
Success #stdin #stdout 0.03s 52480KB
stdin
Standard input is empty
stdout
Array
(
    [0] => http://w...content-available-to-author-only...e.com
    [1] => http://w...content-available-to-author-only...n.com/id.php?site=mysite.com
)