RegExLib.com - The first Regular Expression Library on the Web!

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Pattern Title
Expression
(([0-1][0-9])|([2][0-3])):([0-5][0-9]):([0-5][0-9])
Description
Validates time in MySQL time format. 24 hour time colon seperated hours:minutes:seconds
Matches
09:30:00 | 17:45:20 | 23:59:59
Non-Matches
24:00:00
Author Rating: The rating for this expression. Patrick O'Hara
Source
Your Rating
Bad Good

Enter New Comment

Title

Name

Comment

Spammers suck - we apologize. Please enter the text shown below to enable your comment (not case sensitive - try as many times as you need to if the first ones are too hard):

Existing User Comments

Title: Can't get it to work!
Name: Petsoukos
Date: 9/1/2009 12:34:57 PM
Comment:
I get --> Warning: preg_match_all() [function.preg-match-all]: Unknown modifier ':' in....


Title: parse hours with one digit too
Name: Windfuhr Martin
Date: 2/9/2005 11:46:10 AM
Comment:
with ^([0-9])|([0-1][0-9])|([2][0-3])):([0-5][0-9]):([0-5][0-9])$ you can parse hour one-digit format too. e.g. 9:00:00. nice regex


Title: Missing ^ and $
Name: Dany
Date: 4/13/2004 3:23:55 PM
Comment:
122:12:444 is valid !


Title: Almost Great
Name: Joeb
Date: 3/30/2004 12:58:22 PM
Comment:
Also allows: 24:00:00:00 Should be "No Match" if thrid ":" is present


Copyright © 2001-2024, RegexAdvice.com | ASP.NET Tutorials