开发者

javascript regular expression: how do I find date without year or date with year<2010

I need to find date without year, or date with year<2010. basically,

Feb 15
Feb 20
Feb 20, 2009
Feb 20, 1995

should be accepted

Feb 20, 2010
Feb 20, 2011
开发者_如何学C

should be rejected

How do I do it?

Thanks, Cheng


Try this:

(Jan|Feb|Mar...Dec)\s\d{1,2},\s([1][0-9][0-9][0-9]|200[0-9])

Note: Expand the month list with proepr names. I was too lazy to spell it all out.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜