Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在我的 asp.net 应用程序中,我想以 DD-MM-YYYY 格式输入日期,其中输入的日期应该从今天的日期到 6 个月......否则它应该显示一条错误消息。控制正则表达式验证器的验证表达式是什么?
这是我对正则表达式的拍摄,该表达式测试它是否是您指定格式的有效日期。
^[0-3]?\d-[0-1]?\d-\d{4}$
测试它是否在特定日期范围内超出了正则表达式的能力。
为此,您需要编写一个自定义验证器。