日期:2014-05-18 浏览次数:21023 次
static void Main(string[] args)
{
string str = @"<span class=""sysmsg"">一个闪闪发光的宝箱出现在眼前</span><div class=""nav_right""><a href=""pickBox.jsp?sid=AZxQEI9AyFL1CRX-sBfAyda8&partyId=7784&robotId=300"">捡起来</a></div>";
Regex re = new Regex(@"(?is)<a\s*href="".*?robotId=(\d+)"">捡起来</a>", RegexOptions.IgnoreCase);
Console.WriteLine(re.Match(str).Groups[1].Value); //输出结果:300
Console.ReadLine();
}
------解决方案--------------------