Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
PCRE2 (PHP >=7.3)

/
^(?<year>\d{4})(?:(?<month>\d{2})(?:(?<day>\d{2})(?:(?<hour>\d{2})(?:(?<minute>\d{2})(?:(?<second>\d{2})(?:.(?<millis>\d{3})(?:\[(?:(?<offsetSign>[+-]?)(?<offsetHour>\d{1,2}))(?:.(?<offsetMin>\d{2}))?(?::(?<tz>.*)?)?\])?)?)?)?)?)?)?$
/
gm

Description

Parses an Open Financial Exchange date or date-time string as specified in "3.2.8.1 Dates, Times, and Time Zones" of the OFX Banking Specification, Version 2.3 October 2020.

Submitted by Bryce Marshall - 3 years ago (Last modified 3 years ago)