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-9]|[0-1][0-9]|[2][0-3]):([0-5][0-9])(\s{0,1})(AM|PM|am|pm|aM|Am|pM|Pm{2,2})$)|(^([0-9]|[1][0-9]|[2][0-3])(\s{0,1})(AM|PM|am|pm|aM|Am|pM|Pm{2,2})$)
Description
Validate “Time” Data to Work with SQL Server This is a fix (I hope) for a problem with the original expression. It originally allowed any combination of am or pm. For example: ma, aa, mm, mp, etc.
Matches
8am | 8 am | 8:00 am
Non-Matches
8a | 8 a | 8:00 a
Author Rating: Not yet rated. Greg Burns
Source http://www.dotnetjunkies.com/HowTo/7D7E307A-6CA1-4BB1-AD21-CE45A1CD149D.dcik
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: Thanks
Name: Greg Burns
Date: 2/14/2005 9:24:13 AM
Comment:
Good idea. I've update the link to Julia's original post.


Title: Replace case insensitive
Name: Aamche
Date: 2/14/2005 3:32:57 AM
Comment:
Replace all AM PM with case insensitive match /i e.g. (AM/i|PM/i) should work.


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