正则验证命名是否合法

string regg = @"^[^\\/:\*\?""<>|]{1,120}$";

            if (!Regex.IsMatch(command.NewName, regg))
            {  Console.WriteLine("不合法");
            }
            else {

                Console.WriteLine("合法");
            }
相关文章
相关标签/搜索