Regular Expressions 101

Community Patterns

Timestamp

4

Regular Expression
PCRE (PHP <7.3)

/
([0-2][0-9]|[3][0|1])[.]([0][1-9]|[1][1|2])[.]([0-9]{4})[T]([0|1][0-9]|[2][0-3])([:][0-5][0-9]){2}[.][0-9]{2}
/
g

Description

12.04.1975T03:02:00.88

With milliseconds and T seperator. Excludes most invalid dates, except 30/31ths of month, leap years/february heaving only 29/28.

Submitted by anonymous - 8 years ago