<a target="_blank" href="http://v.ku6.com/show/gm5_RpEWK3oOoUHs.html" onmousedown="return vc(this,'3629652437,358450525','2',2,'1','03:00');" title="《美人心计》 花絮片花">《<font color=#c60a00>美人心计</font>》 花絮片花</a>$StarGet_1 = preg_replace('/<a target="_blank" href="(.+?)" onmousedown="return vc(this,\'(.+?)\',\'(.+?)\',(.+?),\'(.+?)\',\'(.+?)\')\;" title="(.+?)">(.+?)<\/a>/ie',"'<li>'.url_1('\\1').' <a href=\"javascript:void(0)\" onclick=\"javascript:addFlash(\'\\8\',\'\\1\',\'\');\" title=\"影片时间:\\6\">\\8</a></li>'", $StarGet_1);怎么写才可以 这样写无法匹配

解决方案 »

  1.   


    //不知是不是你想要的结果。
    $str=<<<EOD
    <a target="_blank" href="http://v.ku6.com/show/gm5_RpEWK3oOoUHs.html" onmousedown="return vc(this,'3629652437,358450525','2',2,'1','03:00');" title="《美人心计》 花絮片花">《<font color=#c60a00>美人心计</font>》 花絮片花</a>
    EOD;
    preg_match_all('/<a target="_blank" href="([^"]*)" onmousedown="return vc\(([^\)]*)\);" title="(.*)">(.*)<\/a>/i',$str,$matches);
    var_dump($matches);
      

  2.   


    $StarGet_1 = preg_replace('/<a target="_blank" href="(.+?)" onmousedown="return vc\(this,\'(.+?)\',\'(.+?)\',(.+?),\'(.+?)\',\'(.+?)\'\);" title="(.+?)">(.+?)<\/a>/ie',"'<li>'.url_1('\\1').' <a href=\"javascript:void(0)\" onclick=\"javascript:addFlash(\'\\8\',\'\\1\',\'\');\" title=\"影片时间:\\6\">\\8</a></li>'", $StarGet_1);问题解决了 
    夸号需要\ 因为没用这个 也没报错