OhLordy
04-09-2003, 08:21 AM
Can someone help me with a regex to test that something is in the format dd/mm/yyyy as in for a date
Thanks in advance
Rob
Thanks in advance
Rob
|
Click to See Complete Forum and Search --> : regex for dd/mm/yyyy OhLordy 04-09-2003, 08:21 AM Can someone help me with a regex to test that something is in the format dd/mm/yyyy as in for a date Thanks in advance Rob Jona 04-09-2003, 10:22 AM You'll have to be more specific than that. Post your script. This place isn't exactly for professionals to give "freebies" to people. :D OhLordy 04-09-2003, 11:22 AM Really all I need is a link to a tutorial in regular expressions for javascript. I can probably do the rest from there. Jona 04-09-2003, 03:52 PM I don't know of any online tutorials offhand. But you can try searching Google. I always find information I need there... viravan 04-09-2003, 04:03 PM check out the link at the link shown below: http://forums.webdeveloper.com/showthread.php?s=&threadid=7502 :) V.V. viravan 04-09-2003, 04:07 PM After having read my response at that link, consider this. If your intention is to validate a date of the format dd/mm/yyyy, you'll be better off trying to convert the string to a date with that format and catch any exception. RegExp can be used to make sure that you have 2 digits followed by a slash followed by another 2 digits followed by another slash followed by 4 digits. But does that tell you if the date is valid? No, it will not catch invalid month number (00, 13 - 99), nor will it cash a a bad day. Good luck! :) V.V. webdeveloper.com
Copyright Internet.com Inc., All Rights Reserved. |