没有“-”也是允许的
@ "^[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}$|^[0-9a-f]{32}$ ",
====================================
private bool IsGuid(string strToValidate)
{
bool isGuid = false;
string strRegexPatten = @"^(\{){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}(\}){0,1}$";
if (strToValidate != null && !strToValidate.Equals(""))
{
isGuid =System.Text.RegularExpressions.Regex.IsMatch(strToValidate, strRegexPatten);
}
return isGuid;
}