diff --git a/jrnl/Journal.py b/jrnl/Journal.py index a6bf35d0..8e4853ff 100644 --- a/jrnl/Journal.py +++ b/jrnl/Journal.py @@ -128,6 +128,11 @@ class Journal: entries = [] date_blob_re = re.compile("(?:^|\n)\\[([^\\]]+)\\] ") + + # Use strict date matching, if using the default time format + if self.config["timeformat"] == '%Y-%m-%d %H:%M': + 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): date_blob = match.groups()[0]