in reply to Date Validation using just a regex

Ananda, I think you have set yourself an impossible task. For example, some countries write dates with the month first, some with the day first, and some with the year first. If a date was "01/02/03", how could you possibly work out what it means? Secondly, why try to do this in a regex, when there are modules which can do it? CPAN time modules CPAN date modules

Replies are listed 'Best First'.
Re^2: Date Validation using just a regex
by pbeckingham (Parson) on Jul 01, 2004 at 13:15 UTC

    Difficult yes, unwise perhaps, but not impossible.

    If presented with 01/02/03, with absolutely no context, then you would be correct, but that is rarely the case. All it takes is a few heuristics to be able to make sense of that date.