Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
Created·2016-06-01 10:46
Flavor·PCRE (Legacy)

/
(?<dayname>[A-Za-z]{3})\s(?<month>[A-Za-z]{3})\s(?<dayofmonth>\d{2})\s(?<hour>\d{2}):(?<minutes>\d{2}):(?<seconds>\d{2})(?:\.(?<milliseconds>\d*))?\s(?<year>\d{4})
/
i
Open regex in editor

Description

Parse the date from an Apache Error Log in the format of "Wed Jun 01 20:05:21.12345 2016"

Submitted by garys