public bool IsType(string payload) { bool result = Regex.IsMatch(payload, @"\A\b[0-9a-fA-F]+\b\Z") || Regex.IsMatch(payload, @"\A\b(0[xX])?[0-9a-fA-F]+\b\Z"); if (payload.Length%2 != 0) { result = false; } return result; }