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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Current Date For Form Field - mm/dd/yy
Expression
^(0[7-9]|1[012])[/](0[1-9]|[12][0-9]|3[01])[/](19)$
Description
I needed an expression that would capture the current date and at least future dates. Since I needed users to be honest and to pick the present, I adjusted the expression to only read for the following months of the year and the year 2019 specifically. It's not foolproof or particularly sophisticated, but it is easy to read and edit. The input follows: mm/dd/yy.
Matches
07/01/19 | 09/21/19 | 08/31/19
Non-Matches
02/01/19 | 13/52/65 | 06/30/19
Author Rating: Not yet rated. Joanne
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-2025, RegexAdvice.com | ASP.NET Tutorials