Hi all, anyone knows a regular expression for this datetime format? dd/MM/yyyy Thanks in advance.
L Luigi May 12, 2008 #1 Hi all, anyone knows a regular expression for this datetime format? dd/MM/yyyy Thanks in advance.
C CreativeMind May 12, 2008 #2 Hi all, anyone knows a regular expression for this datetime format? dd/MM/yyyy Thanks in advance. Click to expand... Date dd/mm/yyyy 01/01/1900 through 31/12/2099 Matches invalid dates such as February 31st (0[1-9]|[12][0-9]|3[01])[- /.](0[1-9]|1[012])[- /.](19|20)[0-9]{2}
Hi all, anyone knows a regular expression for this datetime format? dd/MM/yyyy Thanks in advance. Click to expand... Date dd/mm/yyyy 01/01/1900 through 31/12/2099 Matches invalid dates such as February 31st (0[1-9]|[12][0-9]|3[01])[- /.](0[1-9]|1[012])[- /.](19|20)[0-9]{2}
L Luigi May 12, 2008 #3 CreativeMind said: Date dd/mm/yyyy 01/01/1900 through 31/12/2099 Matches invalid dates such as February 31st (0[1-9]|[12][0-9]|3[01])[- /.](0[1-9]|1[012])[- /.](19|20)[0-9]{2} Click to expand... Hi, I've tried your regular expression: (0[1-9]|[12][0-9]|3[01])[- /.](0[1-9]|1[012])[- /.](19|20)[0-9]{2} \b(0?[1-9]|[12][0-9]|3[01])[- /.](0?[1-9]|1[012])[- /.](19|20)?[0-9] {2}\b but doesn't work. L
CreativeMind said: Date dd/mm/yyyy 01/01/1900 through 31/12/2099 Matches invalid dates such as February 31st (0[1-9]|[12][0-9]|3[01])[- /.](0[1-9]|1[012])[- /.](19|20)[0-9]{2} Click to expand... Hi, I've tried your regular expression: (0[1-9]|[12][0-9]|3[01])[- /.](0[1-9]|1[012])[- /.](19|20)[0-9]{2} \b(0?[1-9]|[12][0-9]|3[01])[- /.](0?[1-9]|1[012])[- /.](19|20)?[0-9] {2}\b but doesn't work. L
C CreativeMind May 12, 2008 #4 1. (0[1-9]|[12][0-9]|3[01])[- /.](0[1-9]|1[012])[- /.](19|20)[0-9] {2} try it again CreativeMind said: Date dd/mm/yyyy 01/01/1900 through 31/12/2099 Matches invalid dates such as February 31st Click to expand... (0[1-9]|[12][0-9]|3[01])[- /.](0[1-9]|1[012])[- /.](19|20)[0-9]{2} Click to expand... Hi, I've tried your regular expression: (0[1-9]|[12][0-9]|3[01])[- /.](0[1-9]|1[012])[- /.](19|20)[0-9]{2} \b(0?[1-9]|[12][0-9]|3[01])[- /.](0?[1-9]|1[012])[- /.](19|20)?[0-9] {2}\b but doesn't work. L Click to expand...
1. (0[1-9]|[12][0-9]|3[01])[- /.](0[1-9]|1[012])[- /.](19|20)[0-9] {2} try it again CreativeMind said: Date dd/mm/yyyy 01/01/1900 through 31/12/2099 Matches invalid dates such as February 31st Click to expand... (0[1-9]|[12][0-9]|3[01])[- /.](0[1-9]|1[012])[- /.](19|20)[0-9]{2} Click to expand... Hi, I've tried your regular expression: (0[1-9]|[12][0-9]|3[01])[- /.](0[1-9]|1[012])[- /.](19|20)[0-9]{2} \b(0?[1-9]|[12][0-9]|3[01])[- /.](0?[1-9]|1[012])[- /.](19|20)?[0-9] {2}\b but doesn't work. L Click to expand...
L Luigi May 12, 2008 #5 CreativeMind said: 1. (0[1-9]|[12][0-9]|3[01])[- /.](0[1-9]|1[012])[- /.](19|20)[0-9] {2} try it again Click to expand... This one works: (0[1-9]|[12][0-9]|3[01])[- /.](0[1-9]|1[012])[- /.](19|20)[0-9]{2} but accepts also 31/02/2008, that is not correct. L
CreativeMind said: 1. (0[1-9]|[12][0-9]|3[01])[- /.](0[1-9]|1[012])[- /.](19|20)[0-9] {2} try it again Click to expand... This one works: (0[1-9]|[12][0-9]|3[01])[- /.](0[1-9]|1[012])[- /.](19|20)[0-9]{2} but accepts also 31/02/2008, that is not correct. L
C CreativeMind Jun 2, 2008 #6 CreativeMind said: 1. (0[1-9]|[12][0-9]|3[01])[- /.](0[1-9]|1[012])[- /.](19|20)[0-9] {2} try it again Click to expand... This one works: (0[1-9]|[12][0-9]|3[01])[- /.](0[1-9]|1[012])[- /.](19|20)[0-9]{2} but accepts also 31/02/2008, that is not correct. L Click to expand... try this: ^(((0?[1-9]|[12]\d|3[01])[\.\-\/](0?[13578]|1[02])[\.\-\/]((1[6-9]| [2-9]\d)?\d{2}))|((0?[1-9]|[12]\d|30)[\.\-\/](0?[13456789]|1[012])[\.\- \/]((1[6-9]|[2-9]\d)?\d{2}))|((0?[1-9]|1\d|2[0-8])[\.\-\/]0?2[\.\-\/] ((1[6-9]|[2-9]\d)?\d{2}))|(29[\.\-\/]0?2[\.\-\/]((1[6-9]|[2-9]\d)? (0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00)|00)))$
CreativeMind said: 1. (0[1-9]|[12][0-9]|3[01])[- /.](0[1-9]|1[012])[- /.](19|20)[0-9] {2} try it again Click to expand... This one works: (0[1-9]|[12][0-9]|3[01])[- /.](0[1-9]|1[012])[- /.](19|20)[0-9]{2} but accepts also 31/02/2008, that is not correct. L Click to expand... try this: ^(((0?[1-9]|[12]\d|3[01])[\.\-\/](0?[13578]|1[02])[\.\-\/]((1[6-9]| [2-9]\d)?\d{2}))|((0?[1-9]|[12]\d|30)[\.\-\/](0?[13456789]|1[012])[\.\- \/]((1[6-9]|[2-9]\d)?\d{2}))|((0?[1-9]|1\d|2[0-8])[\.\-\/]0?2[\.\-\/] ((1[6-9]|[2-9]\d)?\d{2}))|(29[\.\-\/]0?2[\.\-\/]((1[6-9]|[2-9]\d)? (0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00)|00)))$
L Luigi Jun 2, 2008 #7 CreativeMind said: try this: ^(((0?[1-9]|[12]\d|3[01])[\.\-\/](0?[13578]|1[02])[\.\-\/]((1[6-9]| [2-9]\d)?\d{2}))|((0?[1-9]|[12]\d|30)[\.\-\/](0?[13456789]|1[012])[\.\- \/]((1[6-9]|[2-9]\d)?\d{2}))|((0?[1-9]|1\d|2[0-8])[\.\-\/]0?2[\.\-\/] ((1[6-9]|[2-9]\d)?\d{2}))|(29[\.\-\/]0?2[\.\-\/]((1[6-9]|[2-9]\d)? (0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00)|00)))$ Click to expand... This is better ;-) Thanks a lot. Luigi
CreativeMind said: try this: ^(((0?[1-9]|[12]\d|3[01])[\.\-\/](0?[13578]|1[02])[\.\-\/]((1[6-9]| [2-9]\d)?\d{2}))|((0?[1-9]|[12]\d|30)[\.\-\/](0?[13456789]|1[012])[\.\- \/]((1[6-9]|[2-9]\d)?\d{2}))|((0?[1-9]|1\d|2[0-8])[\.\-\/]0?2[\.\-\/] ((1[6-9]|[2-9]\d)?\d{2}))|(29[\.\-\/]0?2[\.\-\/]((1[6-9]|[2-9]\d)? (0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00)|00)))$ Click to expand... This is better ;-) Thanks a lot. Luigi