Regular Expressions 101

Community Patterns

Credit Card Date (MM/YY)

0

Regular Expression
ECMAScript (JavaScript)

/
^(0[1-9]|1[0-2])\/?([0-9]{2})$
/

Description

Regex for credit card date validation in the format of MM/YY.

Forked from: https://stackoverflow.com/questions/20430391/regular-expression-to-match-credit-card-expiration-date

Submitted by Me - 7 years ago