Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
PCRE (PHP <7.3)

/
^(\s{0,})(\d{2}\/\d{2}\/\d{4})(,\d{2}\/\d{2}\/\d{4}){1,}(\s){0,}$
/

Description

matches a list of comma separated dates in the form dd/mm/yyy. Between two dates must be only a comma. no other character are permitted: matches: 12/03/2011,23/19/1967 Doesn't match: 23/02/2010, 11/11/2011

Submitted by reario - 10 years ago