Regular Expressions 101

Community Patterns

Community Library Entry

13

Regular Expression
ECMAScript (JavaScript)

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

Description

Allows inserting expiry date as MM/YYYY or MM-YYYY format

Submitted by Rider - 10 years ago