Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
Created·2021-09-27 10:52
Updated·2021-09-27 10:55
Flavor·PCRE2 (PHP)

/
^(?<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
Open regex in editor

Description

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

Submitted by anonymous