正则判断字符串中是否包含有guid

 string s = "http://ert.sirr.com/stywebtyp/newscontent?id=5556634a-1432-4a97-827c-e4d6cc581d5c&name=6665534a-1432-4a97-827c-e4d6cc581d5c";
            Regex re = new Regex(@"(?<url>{{0,1}([0-9a-fA-F]){8}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}-([0-9a-fA-F]){12}?)");
            MatchCollection mc = re.Matches(s);
            foreach (Match m in mc)
            {
                string url = m.Result("${url}");
                Console.WriteLine(url);
            }

欢迎评论。。。。让我看到你的反馈。。。。

原文地址:https://www.cnblogs.com/rzm2wxm/p/6929933.html