62,047
社区成员
发帖
与我相关
我的任务
分享
//我要取的<td class="f">与<font size="-1">中间的所有字符
//<td class="f">
//<a onmousedown="return c({'fm':'as','F':'779717EA','F1':'9D73F1E4','F2':'4CA6BD6B','F3':'54E5243F','T':'1280366852','title':this.innerHTML,'url':this.href,'p1':1,'y':'EFBD37AD'})"
// href=" http://www.tianya.cn/publicforum/Content/free/1/459738.shtml" target="_blank">
// <font size="3">今天在<em>深圳</em>201路<em>公交车</em>上,看见二个女白领<em>逃票</em>_天涯杂谈_天涯社区</font></a><br>
// <font size="-1">
public static void TestRegex10()
{
string test = @" //<td class=""f"">
//<a onmousedown=""return c({'fm':'as','F':'779717EA','F1':'9D73F1E4','F2':'4CA6BD6B','F3':'54E5243F','T':'1280366852','title':this.innerHTML,'url':this.href,'p1':1,'y':'EFBD37AD'})""
// href="" http://www.tianya.cn/publicforum/Content/free/1/459738.shtml"" target=""_blank"">
// <font size=""3"">今天在<em>深圳</em>201路<em>公交车</em>上,看见二个女白领<em>逃票</em>_天涯杂谈_天涯社区</font></a><br>
// <font size=""-1"">
";
MatchCollection mc = Regex.Matches(test, @"(?is)(?<=<td class=""f"">).+?(?=<font size=""-1"">)");
foreach (Match m in mc)
{
Console.WriteLine(m.Value);
}
}