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.
如何使用javascript以“10-MAY-2005”格式编写匹配日期的正则表达式。
var regExp = /[0-9]{2}-JANUARY|FEBRUARY|MARCH|APRIL|MAY|JUNE|JULY|AUGUST|SEPTEMBER|OCTOBER|NOVEMBER|DECEMBER-[0-9]{4}/g;
我用了
^(0?[1-9]|[12][0-9]|3[01])[\-] (JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC)[\-]\d{4}$
这对我有用