验证Guid

using System.Text.RegularExpressions;
 
        public static bool IsGuidValid(string inputGuid)
        {
            string pattern = @"^[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}$";
            return Regex.IsMatch(inputGuid, pattern);
        }
posted @ 2012-08-08 20:25  沐雪架构师  阅读(328)  评论(0编辑  收藏  举报