伤心.....POSIX有没有同样的语法啊!
AccountDemander at gmx dot de
01-Dec-2003 02:10 
It's always been a great problem to exclude whole strings. It's easy to exclude a single characters by [^jkhsd], but you cannot exclude whole strings that way... you think!Here's an easy way to exclude strings:
$s = "string to exclude";
preg_match("/[^" . $s . "]/", $string);
Hope this might help... . 

解决方案 »

  1.   

    用这个试试
    <a.*href=\"(.+)\".*>.*<\/a>
      

  2.   

    preg_match_all("'<a href=(.+)</a>'isU",$htm,$m);
    $link=$m["0"];
    print_r($link);
      

  3.   

    建议少用PERL风格的正则表达式,要比POSIX的慢很多。
      

  4.   

    别晕,人家没有学过POSIX风格的正则表达式
      

  5.   

    应该是POSIX的PERL的慢,就算是PERL也不要用POSIX,PERL的通用性高。
    再说了php在这两种不同的正则表达式中的函数库中就是PERL兼容的功能强
      

  6.   

    eregi("<a([^>].*)>([^</a>].*)</a>",$htm,$link);试试看!