Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
PCRE2 (PHP >=7.3)

/
^(?<date>\d{4}-\d{2}-\d{2})\s*(?<time>\d{2}:\d{2}:\d{2}:\d{3})\s*\[\s*(?<level>\w*)\s*(?<module>.*?)\s*\]\s*(?<message>.*)$
/
gmi

Description

Splits the parts of a line in the log of the Nextcloud sync client into usable fragments

Submitted by anonymous - 3 years ago (Last modified 3 years ago)