From 3d1ba6ef4abfdd798c819c8e0613d523c580fb0a Mon Sep 17 00:00:00 2001 From: Ben Kurtovic Date: Thu, 9 Aug 2012 15:55:56 -0400 Subject: [PATCH] Completely case-insensitive matching for signatures. --- earwigbot/tasks/drn_clerkbot.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/earwigbot/tasks/drn_clerkbot.py b/earwigbot/tasks/drn_clerkbot.py index 9ee7cf9..528ddd3 100644 --- a/earwigbot/tasks/drn_clerkbot.py +++ b/earwigbot/tasks/drn_clerkbot.py @@ -456,11 +456,11 @@ class DRNClerkBot(Task): Signatures are returned as tuples of (editor, timestamp as datetime). """ - regex = r"\[\[(?:[uU]ser(?:\stalk)?\:|[sS]pecial\:[cC]ontributions\/)" + regex = r"\[\[(?:User(?:\stalk)?\:|Special\:Contributions\/)" regex += r"([^\n\[\]|]{,256}?)(?:\||\]\])" - regex += r"(?!.*?(?:[uU]ser(?:\stalk)?\:|[sS]pecial\:[cC]ontributions\/).*?)" + regex += r"(?!.*?(?:User(?:\stalk)?\:|Special\:Contributions\/).*?)" regex += r".{,256}?(\d{2}:\d{2},\s\d{1,2}\s\w+\s\d{4}\s\(UTC\))" - matches = re.findall(regex, text, re.U) + matches = re.findall(regex, text, re.U|re.I) signatures = [] for userlink, stamp in matches: username = userlink.split("/", 1)[0].replace("_", " ").strip()