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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Time
Expression
^((0?[1-9]|1[012])(\s*:\s*([0-5]\d))?(\s*:\s*([0-5]\d))?(\s*([AaPp])[Mm]?)$|(2[0-3]|[1]\d|0?\d)(\s*:\s*([0-5]\d))(\s*:\s*([0-5]\d))?)$
Description
Matches a time string. A loose validation for easy user entry. Saves the information needed for a correct time setting.
Matches
3:00:59 | 12pm | 6:30 a
Non-Matches
12 | 25pm | 6:60 a
Author Rating: Not yet rated. Dean Dal Bozzo
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

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