Regular Expressions 101

Parse DateTimes

Open Workspace
  • PCRE (Legacy)
  • Match
1

Regular Expression

/
(.*?) ([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