From: zonidjan Date: Mon, 2 Sep 2019 05:25:15 +0000 (-0500) Subject: fix subtext regex X-Git-Url: https://jfr.im/git/erebus.git/commitdiff_plain/c8de4773a89073f095f5071c8f3350dddab70e2e fix subtext regex --- diff --git a/modules/subtext.py b/modules/subtext.py index 278fe92..894c3f8 100644 --- a/modules/subtext.py +++ b/modules/subtext.py @@ -23,7 +23,7 @@ modstop = lib.modstop # module code import re from collections import namedtuple -re_findsub = re.compile(r"s(.)(?P[^\1]+)\1(?P[^\1]+)\1(?Pg)?;?") +re_findsub = re.compile(r"s(.)(?P.+?)\1(?P.+?)(?:\1(?Pg)?|$)") Line = namedtuple('Line', ['sender', 'msg']) lastline = {} @lib.hooknum("PRIVMSG") @@ -34,6 +34,7 @@ def privmsg_hook(bot, line): msg = pieces[3][1:] mo = re_findsub.match(msg) if mo: + bot.msg(chan, `mo.groups()`) if mo.group('global') is not None: count = 0 # unlimited else: