Regular Expressions 101

Community Patterns

Matching Time in 12-Hour Format

1

Regular Expression
PCRE2 (PHP >=7.3)

/
^(0[1-9]|1[0-2]):[0-5][0-9] (AM|PM)$
/
gm

Description

Submitted by anonymous - a month ago