Community Patterns

Community Library Entry

1

Regular Expression
Created·2021-05-27 11:58
Updated·2021-05-28 10:20
Flavor·PCRE2 (PHP)

/
^\[([\d]{1,2}-[\w]{3,9}-[\d]{4}\s+[\d]{2}:[\d]{2}:[\d]{2}\s+[A-Z]{3,4})\]\s((?s).+?)(?=(?:^\[.+\])|\Z)
/
gm
Open regex in editor

Description

Matches multiline entries (e.g. those containing exception stack traces or just multiline values) in a PHP error log produced by error_log().

Submitted by Anton Ukhanev