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.
我想在格式为“12:15 AM”或“05:15 PM”的文本字段中接受时间,但不允许在文本字段中输入任何内容。那么它的正则表达式是什么。我需要在 MVC4 中的服务器端和客户端进行验证。请帮帮我。谢谢。
尝试在客户端使用一些 jquery 插件:-
http://trentrichardson.com/examples/timepicker/#tp-examples
尝试以下正则表达式
/(?:0[0-9]|1[0-2]):[0-5][0-9]\s*[AP]M/
在此处查看实际情况