Regex.IsMatch(来源, @"^[0-9a-fA-F]{4}$") || Regex.IsMatch(来源,@“^[0-9a-fA-F]{6}$”)|| Regex.IsMatch(来源, @"^[0-9a-fA-F]{8}$") || Regex.IsMatch(来源, @"^[0-9a-fA-F]{10}$") || Regex.IsMatch(来源, @"^[0-9a-fA-F]{12}$") || Regex.IsMatch(来源, @"^[0-9a-fA-F]{14}$") || Regex.IsMatch(来源, @"^[0-9a-fA-F]{16}$"
任何人都可以建议上述正则表达式匹配索引在 4 到 16 之间的快捷方式
你想要两到八对十六进制数字。
^(?:[0-9a-fA-F]{2}){2,8}$