Skip to content

Commit ac4a2d9

Browse files
martinschaermdrxy
authored andcommitted
fix: message line regex (#196)
Tested with a recent backup. Example line: ``` [20/05/2025, 23:58:53] Martin: hello world ``` Co-authored-by: Mason Daugherty <[email protected]>
1 parent 60c3efa commit ac4a2d9

File tree

1 file changed

+1
-1
lines changed
  • libs/community/langchain_community/chat_loaders

1 file changed

+1
-1
lines changed

libs/community/langchain_community/chat_loaders/whatsapp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def __init__(self, path: str):
3838
flags=re.IGNORECASE,
3939
)
4040
self._message_line_regex = re.compile(
41-
r"\u200E*\[?(\d{1,2}/\d{1,2}/\d{2,4}, \d{1,2}:\d{2}:\d{2} (?:AM|PM))\]?[ \u200E]*([^:]+): (.+)", # noqa
41+
r"\u200E*\[?(\d{1,2}\/\d{1,2}\/\d{2,4}, \d{1,2}:\d{2}:\d{2}(?: AM| PM)?)\]?[ \u200E]*([^:]+): (.+)", # noqa
4242
flags=re.IGNORECASE,
4343
)
4444

0 commit comments

Comments
 (0)