Archive for the ‘Javascript’ Category

Javascript time validation explained

Posted on January 20th, 2008 by Dalton Filho

Regular Expressions are one of the most overlooked things in programming. A simple search on Google for form validation returns many cook-book style tutorials that help making things worse by just showing an ugly finished expression (or an even uglier string parsing function). Because it’s so easy to shy away from regular expressions just by seeing them finished, I’ve decided to demonstrate a regular expression construction step-by-step. The expression will validate an hh:mm:ss time pattern.