C# 正则表达式匹配盘符

if (!Regex.IsMatch(diskName, @"^[c-zC-Z](:\\)?$"))
   {
     throw new FormatException($"{diskName} is not an effective disk name.");
   }

猜你喜欢

转载自www.cnblogs.com/144823836yj/p/9656410.html
今日推荐