G
Guest
What is the best way to validate that a date entered into a V/B .net textbox is in the proper format to be converted into an Oracle Date format? (e.g. DD-MON-YYYY.) I don't care about the time portion. I am using this:
^\d{2}(-)(JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC)(-)\d{4}$
but the problem is that it is not specific enough. For example, 44-MAR-2004 is acceptable/matched. I would like to restrict the first 2 digits to what is appropriate for the month, e.g. no greater than 31 in this case. Leap year logic would be good also.
Can anyone point me to a regular expression that they know about that works for this purpose, and that will also run properly in .net? I need a specific routine that someone out there uses and is comfortable with, rather than a URL to a general Regular Expression Web Site.
T H A N K S ! ! !
^\d{2}(-)(JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC)(-)\d{4}$
but the problem is that it is not specific enough. For example, 44-MAR-2004 is acceptable/matched. I would like to restrict the first 2 digits to what is appropriate for the month, e.g. no greater than 31 in this case. Leap year logic would be good also.
Can anyone point me to a regular expression that they know about that works for this purpose, and that will also run properly in .net? I need a specific routine that someone out there uses and is comfortable with, rather than a URL to a general Regular Expression Web Site.
T H A N K S ! ! !