正则表达式用来匹配a标签中的title。返回的值只有title。
怎么写
谢谢
string resultHtml = getHtml("http://bbs.csdn.net/topics/391047173");
//获取a标签中href
//string regexHref = @"(?is)[^'""]*)[^<]*";
//获取a标签中title
string regexHrefTitleInA2 = @"(?=";
var matches = Regex.Matches(resultHtml, regexHrefTitleInA2);
foreach (Match item in matches)
{
if (item.Success)
{
Console.WriteLine(item.Value);
}
Console.WriteLine();
}
Console.Read();
言,括号内表示某个位置右边必须和=右边匹配上
这是零宽断言
http://blog.csdn.net/panhf2003/article/details/3337163
在你这里是获取a标签中标题