我有一个简单的regularExpression,它检查给定的信息是否只有4位数,只包含数字。我有一些有用的东西,但它不允许用户以0开始关闭第一个数字,任何想法为什么?这是我的regularrexpression
[RegularExpression("^[0-9]{4,4}$", ErrorMessage = "PIN did not follow the correct format of 4-digits")]
更多信息
[必填(ErrorMessage =“请输入您的4位数字。”)] [RegularExpression(“^ [0-9] {4,4} $”,ErrorMessage =“PIN没有遵循正确的4位数字格式”)] [显示(名称=“PIN”)] 公共长PIN {get;组; }