MatchCollection的用法

来源:互联网 发布:php实时统计在线人数 编辑:程序博客网 时间:2024/05/16 07:26

        lbl.Text = "";
        string test = "##BBB##<html><head></head><body>##AAA##</body></html>";
        MatchCollection mc = Regex.Matches(test, @"##/w+##", RegexOptions.IgnoreCase);
        string strTemp = "";
        foreach (Match m in mc)
        {

            if (!strTemp.Contains(m.Value))
            {
                this.lbl.Text += m.Value + "/n";
              
            }
         
        }

原创粉丝点击