一字符串:
<td align="center" foroyesgo="target">
<a href="http://www.fortraveler.com/ch/travel_guide/destination_guide/u/prague/index.html" class="absu" title="布拉格" target="_blank">布拉格</a>,<a href="http://www.fortraveler.com/ch/travel_guide/destination_guide/u/krumlov/index.html" class="absu" title="克罗姆洛夫" target="_blank">克罗姆洛夫</a>,<a href="http://www.fortraveler.com/ch/travel_guide/destination_guide/u/budejovice/index.html" class="absu" title="布杰约维采" target="_blank">布杰约维采</a>
</td>
没有回车换行符,求<td align="center" foroyesgo="target">与</td>之间的值。
thanks

解决方案 »

  1.   

    就是用正则表达式,求<td   align= "center "   foroyesgo= "target "> 与 </td> 之间的值..
    如:
    Match m = Regex.Match(@"<td   align=\""center"   foroyesgo= \""target\"">(?<text>)</td>");
    if ( m.Success)
    {
    Response.Write(m.Groups["text"])
    }
    以上部分在(?<text>这里不知道写什么)高手出..
      

  2.   

    Regex.Match方法没有那样的重载Match m = Regex.Match(yourStr, @"<td[^>]*>(?<text>[\s\S]*?)</td>", RegexOptions.IgnoreCase);
    if (m.Success)
    {
        Response.Write(m.Groups["text"].Value);
    }
      

  3.   

    4retretretretrewtrewtrewtrewtretretretrttryyuytuuiuipoioiopo
      

  4.   


    Regex matchesregex = new Regex(@"<td[^>]*>(?<text>[\s\S]*?)</td>", RegexOptions.IgnoreCase | RegexOptions.Multiline); 
    MatchCollection matchesfound; 
    //Match matchmade;
    matchesfound = matchesregex.Matches(strcontent);

    foreach(Match matchmade in matchesfound)
    {
    if(matchmade.Value!=null && matchmade.Value!="")
    {
    strposi = strposi + matchmade.Value;
    }

    }