现在的位置: 首页 > 综合 > 正文

正则匹配代码

2012年09月21日 ⁄ 综合 ⁄ 共 427字 ⁄ 字号 评论关闭

            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

抱歉!评论已关闭.