I'm working on Data::FormValidator again. This time I'm working on adding some date validation to the core module. I'd like to make my solution scalable so it's easy to validate dates in other formats besides the ones I prefer myself.
My plan is to parse a string with a regular expression, and then feed it to Date::Calc's check_time() and check_date() functions.
I realize Date::Manip is out there as a solution that will parse most any string, but's such a beast to load.
I'm thinking of an interface like this
valid_date($your_date, 'MM/DD/YYYY'),
What I'm hoping to find is that there is easy way to start with this input and end up with ($mm,$dd,$yyyy), given the possibilities for a variety of different date formats.
As an alternative, we could use a solution that hard codes a few of the popular date formats, so the interface would look more like this:
valid_date($your_date, 'US'),
Thanks for any suggestions!
-mark
In reply to date format string -> Reg Ex solution by markjugg
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |