From 7cda82546a87575e04115ec8337983b6c427c063 Mon Sep 17 00:00:00 2001 From: Ben Kurtovic Date: Tue, 10 Jul 2012 22:26:10 -0400 Subject: [PATCH] More sophisticated regex for parsing links. --- earwigbot/commands/dictionary.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/earwigbot/commands/dictionary.py b/earwigbot/commands/dictionary.py index 533bfb4..9aab566 100644 --- a/earwigbot/commands/dictionary.py +++ b/earwigbot/commands/dictionary.py @@ -128,7 +128,7 @@ class Dictionary(Command): def parse_body(self, body): substitutions = [ ("", ""), - ("\[\[(.*?)\|(.*?)\]\]", r"\2"), + ("\[\[[^\]|]*?\|([^\]|]*?)\]\]", r"\1"), ("\{\{(.*?) of\|(.*?)\}\}", r"\1 of \2."), ("\{\{w\|(.*?)\}\}", r"\1"), ("\{\{surname(.*?)\}\}", r"A surname."),