110,499
社区成员
发帖
与我相关
我的任务
分享
string text = @"<a href=""play.html?c=frocalxod9b740yx"" title=""活动"">";
string patten = @"(href|title)=""([^""]*)";
Regex.Matches(text, patten).Cast<Match>().ToList().ForEach(x =>
{
Console.WriteLine(string.Format("{0}: {1}", x.Groups[1].Value, x.Groups[2].Value));
});
string html = @"<a href=""play.html?c=frocalxod9b740yx"" title=""活动"">";
string patten = @"<a\s+.*?href=""([^""]*)""\s+.*?title=""([^""]*)"".*?>";
Regex.Matches(html, patten).Cast<Match>().ToList().ForEach(x=>
{
Console.WriteLine(string.Format("href:{0} title:{1}", x.Groups[1].Value, x.Groups[2].Value));
});