Merge 2 regexps into 1

This commit is contained in:
Antoine Nguyen
2024-11-28 20:39:57 +01:00
parent 7cfb952b3c
commit c321f201d4
@@ -81,8 +81,7 @@ class LogParser:
# set up regular expression
self._date_expressions = [
r"(?P<month>\w+)\s+(?P<day>\d+)\s+(?P<hour>\d+):(?P<min>\d+):(?P<sec>\d+)(?P<eol>.*)", # noqa
r"(?P<year>\d+)-(?P<month>\d+)-(?P<day>\d+)T(?P<hour>\d+):(?P<min>\d+):(?P<sec>\d+)\.\d+\+\d+:\d+(?P<eol>.*)", # noqa
r"(?P<year>\d+)-(?P<month>\d+)-(?P<day>\d+)T(?P<hour>\d+):(?P<min>\d+):(?P<sec>\d+)\.\d+\-\d+:\d+(?P<eol>.*)", # noqa
r"(?P<year>\d+)-(?P<month>\d+)-(?P<day>\d+)T(?P<hour>\d+):(?P<min>\d+):(?P<sec>\d+)\.\d+[\+\-]\d+:\d+(?P<eol>.*)", # noqa
]
self._date_expressions = [re.compile(v) for v in self._date_expressions]
self.date_expr = None