Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
PCRE (PHP <7.3)

/
(.*?) ([0-9]|0[0-9]|1[0-9]|2[0-3]):([0-5][0-9]):?([0-5][0-9])?( AM| PM)?( [+-]\d{4})?
/

Description

Will parse a DateTime and group the results. Probably pretty limited but it works for me.

Submitted by martin - 11 years ago