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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find 12-hr Time
Expression
^(([0][0-9]|[1][0-2])|[0-9]):([0-5][0-9])( *)((AM|PM)|(A|P))$
Description
Matches a string if it is a valid time in the format of "HH:MM AM" or "HH:MM A".
Matches
1:30 AM | 01:20 AM | 10:00A | 11:50P
Non-Matches
13:00 A | 01:5 AM
Author Rating: The rating for this expression. rodel surat
Source http://regexlib.com/UserPatterns.aspx?authorId=0537ba48-ec50-475d-99ab-887a787ea9d4
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