Regular Expressions 101

Matching Time in 12-Hour Format

Open Workspace
  • PCRE2 (PHP)
  • Match
1

Regular Expression

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

Description

Submitted by Anonymous