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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Credit Card Expiration Date Validator
Expression
^((0[1-9])|(1[0-2]))[\/\.\-]*((0[8-9])|(1[1-9]))$
Description
Validates major credit card expiration dates in MM/YY, MM.YY, MM-YY, or MMYY. Year range is 08-19.
Matches
01/08 | 01-08 | 01.08 | 12/10 | 12/19 | 0109
Non-Matches
01/06 | 01/20 | 0a09 | 00/09
Author Rating: Not yet rated. Dan Cardoso
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

Title: Edit
Name: Tester
Date: 10/14/2008 1:25:24 PM
Comment:
Reg expression needs to be changed to catch the year 2010. Needs to be changed to ^((0[1-9])|(1[0-2]))[\/\.\-]*((0[8-9])|(1[0-9]))$. The change is the last set of numbers, from (1[1-9]) to (1[0-9]). Looks good otherwise.


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