110,530
社区成员
发帖
与我相关
我的任务
分享
List<string> list = new List<string> { ",1231", "12312,", "1231", "1231,123", "1231,1321,", "fds" };
Regex reg = new Regex(@"^(\d+,?)*(?=\d$)");
foreach (string s in list)
Console.WriteLine(reg.Match(s).Success);
^\d+(,\d+)*$
"^[0-9]+(,[0-9]+)*$"
// C#中\d可代表全角数字