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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Time
Expression
^([0-2][0-4](?:(?:(?::)?[0-5][0-9])?|(?:(?::)?[0-5][0-9](?::)?[0-5][0-9](?:\.[0-9]+)?)?)?)$
Description
This is a regular expression to check for a properly formatted time according to the international date and time notation ISO 8601. See ISO 8601 specification for more information.
Matches
24 | 24:00 | 23:59:59 | 235959
Non-Matches
25 | 24:60
Author Rating: The rating for this expression. tedcambron
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: Updated
Name: Ted Cambron
Date: 2/10/2008 5:36:28 PM
Comment:
Now allows for the decimal point and numbers after with seconds as ISO permits.


Title: Updated
Name: Ted Cambron
Date: 2/10/2008 5:36:20 PM
Comment:
Now allows for the decimal point and numbers after with seconds as ISO permits.


Title: Almost
Name: Ted Cambron
Date: 2/9/2008 8:58:19 PM
Comment:
I just noticed that it doesn't allow for fractional seconds which is ISO 8601 compliant. I will update it to allow a decimal point and some digits on the end later.


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