<A href="tail.asp?ID=5316306&amp;tID=5712071&amp;ply=1">文字</A>
<A href="tail.asp?ID=5316307&amp;tID=5712072&amp;ply=1">文字</A>
<A href="tail.asp?ID=5316308&amp;tID=5712073&amp;ply=1">文字</A>
<A href="tail.asp?ID=5316309&amp;tID=5712074&amp;ply=1">文字</A>
<A href="tail.asp?ID=5316310&amp;tID=5712075&amp;ply=1">文字</A>
<A href="tail.asp?ID=5316311&amp;tID=5712076&amp;ply=1">文字</A>
<A href="tail.asp?ID=5316312&amp;tID=5712077&amp;ply=1">文字</A>取出tail.asp?ID=5316306&amp;tID=5712071&amp;ply=1这段链接,
他们都包含tail.asp

解决方案 »

  1.   

    string strReg = @"<a[\s\S]*?href[\s]?=""(?<href>.*?)""\s*[^>]*>*.?</a>";
    Regex regex = new Regex(strPattern, RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture|RegexOptions.Multiline);
    MatchCollection hrefMath = regex.Matches("stringHtml");
    foreach (Match href in hrefMath)
    {
       Consolse.Write(href.Group["href"].value);} 
    试试 
                  
      

  2.   

    只要这tail.asp?ID=5316306&amp;tID=5712071&amp;ply=1一段 还是所有 tail.asp?
      

  3.   

    只要
    tail.asp?ID=5316306&amp;tID=5712071&amp;ply=1一段