Regular Expressions 101

Community Patterns

Creditcard expiry date checker

2

Regular Expression
PCRE (PHP <7.3)

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

Description

Checks if a expiry date is: mm/yy. You still have to check if it is a valid expiry date timewise.

Submitted by Pevawi - 10 years ago