From fb1f42ada4c7faa3c509ab429a6e6a0597728e88 Mon Sep 17 00:00:00 2001 From: phongvis Date: Fri, 26 Jun 2020 08:38:17 +0100 Subject: [PATCH] Limit gap between On and wrote: --- email_reply_parser/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/email_reply_parser/__init__.py b/email_reply_parser/__init__.py index 063f65b..f7df390 100644 --- a/email_reply_parser/__init__.py +++ b/email_reply_parser/__init__.py @@ -40,7 +40,7 @@ class EmailMessage(object): QUOTE_HDR_REGEX = re.compile('On.*wrote:$') QUOTED_REGEX = re.compile(r'(>+)') HEADER_REGEX = re.compile(r'^\*?(From|Sent|To|Subject):\*? .+') - _MULTI_QUOTE_HDR_REGEX = r'(?!On.*On\s.+?wrote:)(On\s(.+?)wrote:)' + _MULTI_QUOTE_HDR_REGEX = r'(?!On.*On\s.{1,100}?wrote:)(On\s(.{1,100}?)wrote:)' MULTI_QUOTE_HDR_REGEX = re.compile(_MULTI_QUOTE_HDR_REGEX, re.DOTALL | re.MULTILINE) MULTI_QUOTE_HDR_REGEX_MULTILINE = re.compile(_MULTI_QUOTE_HDR_REGEX, re.DOTALL)