本文介绍了日期表达式的正则表达式,用于2月验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试过这个表达但是它不会采取2010年之前的日期,如果你能告诉我我犯了哪个错误,这将是一个很大的帮助。



我尝试过:



/ ^(((((0?[1-9])|([1 -2] [0-9])|(3 [0-1])) - (([JJ] [AA] [NN])|([mm]的[AA] [RR])|([mm]的[ AA] [YY])|([JJ] [UU] [11])|([AA] [UU] [gG的])|([OO] [CC] [TT])|([日] [EE] [CC])))|(((0 [1-9])|([1-2] [0-9])|(30)) - (([AA] [PP] [RR])?| ([JJ] [UU] [NN])|([SS] [EE] [PP])|([NN] [OO] [VV])))|(((0 [1-9])| (1 [0-9])|(2 [0-8])) - ([FF] [EE] [BB]))) - (20(([13579] [01345789])|([2468] [ 1235679]))))|(((((0 [1-9])|([1-2] [0-9])|(3 [0-1])) - (([JJ] [ AA] [NN])|([mm]的[AA] [RR])|([mm]的[AA] [YY])|([JJ] [UU] [11])|([AA] [UU] [gG的])|([OO] [CC] [TT])|([日] [EE] [CC])))|(((0 [1-9])|([1-2] [ 0-9])|(30)) - (([AA] [PP] [RR])|([JJ] [UU] [NN])|([SS] [EE] [PP])|([ NN] [OO] [VV])))|(((0 [1-9])|(1 [0-9])|→(2 [0-9])) - ([FF] [EE] [bB]))) - (20(([13579] [26])|([2468] [048])))))$ /

I tried this expression but it wont take dates which are before the year 2010 it would be a big help if you can tell me where i have made the mistake.

What I have tried:

/^((((((0?[1-9])|([1-2][0-9])|(3[0-1]))-(([jJ][aA][nN])|([mM][aA][rR])|([mM][aA][yY])|([jJ][uU][lL])|([aA][uU][gG])|([oO][cC][tT])|([dD][eE][cC])))|(((0?[1-9])|([1-2][0-9])|(30))-(([aA][pP][rR])|([jJ][uU][nN])|([sS][eE][pP])|([nN][oO][vV])))|(((0?[1-9])|(1[0-9])|(2[0-8]))-([fF][eE][bB])))-(20(([13579][01345789])|([2468][1235679]))))|(((((0?[1-9])|([1-2][0-9])|(3[0-1]))-(([jJ][aA][nN])|([mM][aA][rR])|([mM][aA][yY])|([jJ][uU][lL])|([aA][uU][gG])|([oO][cC][tT])|([dD][eE][cC])))|(((0?[1-9])|([1-2][0-9])|(30))-(([aA][pP][rR])|([jJ][uU][nN])|([sS][eE][pP])|([nN][oO][vV])))|(((0?[1-9])|(1[0-9])|(2[0-9]))-([fF][eE][bB])))-(20(([13579][26])|([2468][048])))))$/

推荐答案




这篇关于日期表达式的正则表达式,用于2月验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-12 11:40