From 034e86762ed9d669215cb47f4d5d6bcfc06e1856 Mon Sep 17 00:00:00 2001 From: Lenahan Michael Date: Wed, 30 Sep 2020 16:29:49 +0200 Subject: [PATCH] Use strict regex when timeformat_strict config true --- jrnl/Journal.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/jrnl/Journal.py b/jrnl/Journal.py index 83d3d921..f7cae1ec 100644 --- a/jrnl/Journal.py +++ b/jrnl/Journal.py @@ -135,7 +135,9 @@ class Journal: # (2) if timeformat_strict is set to true. if self.config["timeformat"] == "%Y-%m-%d %H:%M": if self.config["timeformat_strict"]: - date_blob_re = re.compile("(?:^|\n)\\[(\d{4}-\d{2}-\d{2} \d{2}:\d{2})\\] ") + date_blob_re = re.compile( + "(?:^|\n)\\[(\d{4}-\d{2}-\d{2} \d{2}:\d{2})\\] " + ) last_entry_pos = 0 for match in date_blob_re.finditer(journal_txt):