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

Please support RegExLib Sponsors

Sponsors

Expressions by User

   Displaying page 1 of 1 pages; Items 1 to 1
Title Test Details DateTime
Expression
^(0?[1-9]|[12][0-9]|3[01])[- /.](0?[1-9]|1[012])[- /.](19|20)?[0-9]{2}? ?((([0-1]?\d)|(2[0-3])):[0-5]\d)?(:[0-5]\d)? ?([a,p,A,P][m,M])?$
Description
Regex to match date and or time either in 12 or 24 hour format. It will also allow for am/pm with mixed cases.
Matches
31-12-2010 14:15:22 | 1.1.2010 00:00:00 | 2/1/2010 | 31/1/2011 05:22 pm
Non-Matches
1.31.2011 | 31.1.2011 1455 | 31.1.2011 14 pm
Author Rating: Not yet rated. Ralf Koch
   Displaying page 1 of 1 pages; Items 1 to 1

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