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); }
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); }