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})(?<minutes>\d{2})(?<seconds>\d{2}).*$
/
gm

Description

Returns object with dateTime elements .Designed for FiletimeStamp of logging module

Submitted by Stéphane van Gulick - a year ago