久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放AV片

<center id="vfaef"><input id="vfaef"><table id="vfaef"></table></input></center>

    <p id="vfaef"><kbd id="vfaef"></kbd></p>

    
    
    <pre id="vfaef"><u id="vfaef"></u></pre>

      <thead id="vfaef"><input id="vfaef"></input></thead>

    1. 站長(zhǎng)資訊網(wǎng)
      最全最豐富的資訊網(wǎng)站

      php 正則表達(dá)式提取網(wǎng)頁(yè)超級(jí)鏈接url的函數(shù)

      復(fù)制代碼 代碼如下:
      function match_links($document) {
      preg_match_all(“‘<s*as.*?hrefs*=s*([“‘])?(?(1)(.*?)\1|([^s>]+))[^>]*>?(.*?)</a>’isx”,$document,$links);
      while(list($key,$val) = each($links[2])) {
      if(!empty($val))
      $match[‘link’][] = $val;
      }
      while(list($key,$val) = each($links[3])) {
      if(!empty($val))
      $match[‘link’][] = $val;
      }
      while(list($key,$val) = each($links[4])) {
      if(!empty($val))
      $match[‘content’][] = $val;
      }
      while(list($key,$val) = each($links[0])) {
      if(!empty($val))
      $match[‘all’][] = $val;
      }
      return $match;
      }

      主要是正則的問(wèn)題,下面給出個(gè)asp.net下的,多測(cè)試正則
      獲取頁(yè)面的鏈接正則

      復(fù)制代碼 代碼如下:
      public string GetHref(string HtmlCode)
      {
      string MatchVale = “”;
      string Reg = @”(h|H)(r|R)(e|E)(f|F) *= *(‘|””)?((w|\|/|.|:|-|_)+)(‘|””| *|>)?”;
      foreach (Match m in Regex.Matches(HtmlCode, Reg))
      {
      MatchVale += (m.Value).ToLower().Replace(“href=”, “”).Trim() + “||”;
      }
      return MatchVale;
      }
      贊(0)
      分享到: 更多 (0)
      網(wǎng)站地圖   滬ICP備18035694號(hào)-2    滬公網(wǎng)安備31011702889846號(hào)