一字符串:
<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
<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
如:
Match m = Regex.Match(@"<td align=\""center" foroyesgo= \""target\"">(?<text>)</td>");
if ( m.Success)
{
Response.Write(m.Groups["text"])
}
以上部分在(?<text>这里不知道写什么)高手出..
if (m.Success)
{
Response.Write(m.Groups["text"].Value);
}
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;
}
}