正则匹配代码

            Regex rx = new Regex(@"(\d+).\x20target...blank.\x20{1,5}style=.LINE-HEIGHT:150%.>",
            RegexOptions.Compiled | RegexOptions.IgnoreCase);
            MatchCollection _oMatchColl = rx.Matches(weatherhtml);

            string str = string.Empty;
            foreach (Match match in _oMatchColl)
            {
                GroupCollection groups = match.Groups;

                 str = groups[1].ToString();

            }

 

 

推荐一款写正则的软件:RegexTester

posted on 2011-12-01 09:50  张扬个性,敢为天下先  阅读(400)  评论(0编辑  收藏  举报