My Mighty Blog

Listen to me and label every single thing I say as a 'fact'. You do it for the news networks, why not me??? These are my views on current events, family, news, government, technology, internet, programming, and whatever else pops into my head.

My Photo
Name:
Location: Central Florida, United States

Good Ol' Boy turned nerd

Previous Posts
Visit the Site

Powered by Blogger

MARVEL and SPIDER-MAN: TM & © 2007 Marvel Characters, Inc. Motion Picture © 2007 Columbia Pictures Industries, Inc. All Rights Reserved. © 2007 Sony Pictures Digital Inc. All rights reserved.
Regular Expression - Date
Tuesday, April 10, 2007 |
I have another one for you! This one will validate a date within the current century. This should be sufficient enough for most current applications.

^([0-1]?[0-9]{1}/[0-3]?[0-9]{1}/20[0-9]{2})$

The preceding regular expression will, like the previous posting on time, validate most date options. The weaknesses with this one is that it will allow the days to go up to 39 and does not account for leap year. Also, the months can go up to 19, instead of our commonly accepted 12 month year. :)

I designed this expression to validate dates from the year 2000 to 2099. I do not plan on this same code being in place in 2099, so I hope this is sufficient enough...

Labels: , , ,

posted by The Mighty Will @ permalink  

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home