Regular Expressions 101

Community Patterns

Valid Date or N/A

1

Regular Expression
PCRE (PHP <7.3)

/
^(([1-9]|0[1-9]|1[0-2])\/([1-9]|0[1-9]|1\d|2\d|3[01])\/(19|20)\d{2}|[nN]\/[aA])$
/
gm

Description

Validates date or allows "n/a" input and variations

Submitted by David Avellan - 8 years ago