[问题] 不知道错误点在哪 求解

楼主: justlike5566 (5566天下无敌)   2014-03-15 11:08:03
刚在测试正则表达式写了两行
string reg =@"<DT><A\s.+?[k]>(?<title>.+?)</A>\s+<P><SPAN>(?<author>\w+?)
\s\w+<EM>(?<datetime>\d{4}\-\d{2}\-\d{2}\s+\d{2}:\d{2}:\d{2})
</EM>.+?<DIV\s+.+?>\s+<P>(?<content>.+?)</P></DIV>";
string reg =@"<DT><A\s.+?[k]>(?<title>.+?)</A>\s+<p><span>(?<author>.+?)
\s\w+<em>(?<datetime>\d{4}-\d{2}-\d{2}\s\d{2}:\d{2}:\d{2})
</em>.+?<DIV\s+.+?>\s+<P>(?<content>.+?)</P></DIV>";
MatchCollection matches=Regex.Matches(content, reg,RegexOptions.Singleline);
foreach (Match item in matches)
{}
两个意义是一样的 抓题目 作者 时间 内文 并在测试软件里测试都成功
测试后要套后时 第一行在vs2010可以很顺利的抓下来
但第两行就会卡死后没有回应 设中断点看 他在foreach "in"之后就卡著了
不知道原因是什么 求神人提示一下

Links booklink

Contact Us: admin [ a t ] ucptt.com