Beefy Boxes and Bandwidth Generously Provided by pair Networks Frank
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Date Validation using just a regex

by beable (Friar)
on Jul 01, 2004 at 05:08 UTC ( [id://371018]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


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 09: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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://371018]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.