日期:2014-05-18 浏览次数:20472 次
string source = @"title=""截至2012-03-21 10:49:36,用户的总技术分为:12397;截至2012-03-18日,用户的总技术分排名为:2349"">";
Regex regs = new Regex(@"title=(?<title>[^>]*)>");
MatchCollection mc = regs.Matches(source);
foreach (Match m in mc)
{
MessageBox.Show(m.Groups["title"].Value);
}
------解决方案--------------------
Regex re = new Regex(@"(?is)(?<=title="").*?(?="")", RegexOptions.None);
MatchCollection mc = re.Matches(你要提取的字符串);
foreach (Match ma in mc)
{
//ma.Value就是你要的
}