RegEx Question - Disregard
Hey everyone,
I have been messing with this expression forever; what I am trying to do is determine if a date (year part) is between 1900 and 9999.
This expression will validate any year between 1900 - 1999 and 9000 - 9999
(0[1-9]|1[012])[/](0[1-9]|[12][0-9]|3[01])[/](19|99)\d\d
So, I figured that I would just make a range as such:
(0[1-9]|1[012])[/](0[1-9]|[12][0-9]|3[01])[/]([19-99])\d\d
Which fails when you enter any date between the aforementioned range so, I am suspecting, that the range is only valid for [0-9] so does that mean I am going to have to do a condition for each possible 1000 years?
--Disregard
After I posted this I thought the logic out a bit more and this expression works:
(0[1-9]|1[012])[/](0[1-9]|[12][0-9]|3[01])[/]((19)|([2-9][0-9]))\d\d
"The one language all programmers understand is profanity."
__________________
===============================================
Doug Parsons
Wrox online library: Wrox Books 24 x 7
Did someone here help you? Click  on their post!
"Easy is the path to wisdom for those not blinded by themselves."
===============================================
|