Im pretty new to using regular expressions - up to now ive never had a problem but I need to validate a date on my form for use in oracle(DD-MMM-YYYY or DD-MMM-YY).
My first attempt goes a little something like this...
if (!eregi("^
( (([0-2]{1})([0-9]{1})) | (([3]{1})([0-1]{1})) )
(-[JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC])
(-[0-9]{2,4}) +$"
)
The idea is to
1. ensure first number is 00-29 | 30-31
2. find a hyphen then JAN-DEC
3. ensure last number is 0000-9999
I've an idea that this is way off, so would appreciate any help
My first attempt goes a little something like this...
if (!eregi("^
( (([0-2]{1})([0-9]{1})) | (([3]{1})([0-1]{1})) )
(-[JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC])
(-[0-9]{2,4}) +$"

The idea is to
1. ensure first number is 00-29 | 30-31
2. find a hyphen then JAN-DEC
3. ensure last number is 0000-9999
I've an idea that this is way off, so would appreciate any help