用代码实现时候匹配不成功,用软件匹配成功,请问是什么问题?MatchCollection MatchReply = new Regex("<font.+?post-jb").Matches(PostHtml);这句,PostHtml不为空,MatchReply为空,但是用软件匹配成功。求赐教。

解决方案 »

  1.   

    http://www.tianya.cn/publicforum/content/filmtv/1/353130.shtml
    数据源是这里的HTML源码
      

  2.   


     string input = File.ReadAllText(@"C:\1.txt", Encoding.GetEncoding("gb2312"));
                MatchCollection mc = Regex.Matches(input, @"<font.+?post-jb");
                foreach (Match m in mc)
                {
                    Response.Write(m.Value);
                }
      

  3.   

    MatchCollection MatchReply = Regex.Matches(PostHtml,@"(?is)<font\b.*?post-jb");