关键语句:
@(.*?)<a\s([^>]*?)href=([\'\"\s]?)([^>\'\"\s]+)([\'\"\s]?)([^>]*?)>(.+?)</a>(.*)@is附带一个获取页面所有链接的例子:<?
      $f=file('http://duan.onmoon.com');
      $str="";
      while(list($line_num,$line)=each($f))
     {
 $str.=$line;
      }
      $count=0;
      $ptn="@(.*?)<a\s([^>]*?)href=([\'\"\s]?)([^>\'\"\s]+)([\'\"\s]?)([^>]*?)>(.+?)</a>(.*)@is";
 while(preg_match($ptn,$str,$reg))
 {
             echo "-----------------------------------------------------------------------------------";
     $count++;
     echo "〖".$reg[4]."〗<br/>";
     echo $count."【".$reg[7]."】<br/>";
     $str=$reg[1].$reg[8];
 }
?>