Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Date Validation using just a regex

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


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://371018]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (3)
As of 2024-04-20 01:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found