Regular Expressions 101

Community Patterns

1...56789...589

Time with AM & PM

0

Regular Expression
PCRE2 (PHP >=7.3)

/
([0-9]|[0-1][0-2])\:?([0-5][0-9])? ([A|P]M) to ([0-9]|[0-1][0-2])\:?([0-5][0-9])? ([A|P]M)
/
gm

Description

This is a re that can validate time with date with AM and PM

Submitted by anonymous - a year ago