[問題] 不知道錯誤點在哪 求解

作者: 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