From 85495e38b92fdf3f9d5f138fe8d0370f810b6d6c Mon Sep 17 00:00:00 2001 From: Ben Kurtovic Date: Tue, 31 Jul 2012 23:12:22 -0400 Subject: [PATCH] Use a massively more complicated (yet more accurate) regex. --- earwigbot/tasks/drn_clerkbot.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/earwigbot/tasks/drn_clerkbot.py b/earwigbot/tasks/drn_clerkbot.py index efecc3c..3f462e5 100644 --- a/earwigbot/tasks/drn_clerkbot.py +++ b/earwigbot/tasks/drn_clerkbot.py @@ -353,7 +353,10 @@ class DRNClerkBot(Task): case.status = self.STATUS_REVIEW def read_signatures(self, text): - regex = r"\[\[(?:User(?:\stalk)?\:|Special\:Contributions\/)(.*?)(?:\||\]\]).{,256}?(\d{2}:\d{2},\s\d{2}\s\w+\s\d{4}\s\(UTC\))" + regex = r"\[\[(?:User(?:\stalk)?\:|Special\:Contributions\/)" + regex += r"([^\n\[\]|]{,256}?)(?:\||\]\])" + regex += r"(?!.*?(?:User(?:\stalk)?\:|Special\:Contributions\/).*?)" + regex += r".{,256}?(\d{2}:\d{2},\s\d{2}\s\w+\s\d{4}\s\(UTC\))" matches = re.findall(regex, text, re.U) signatures = [] for userlink, stamp in matches: