Karma: in the element regex, match ()ful version before ()less version

the motivation here is doing (foo)++ would match \S+ first, adding
(foo) to the karma database (rather than foo, which is probably what
the user meant)
This commit is contained in:
Brian S. Stephan 2011-03-02 16:17:59 -06:00
parent 250dd6c4b0
commit c17623bcf6

View File

@ -34,7 +34,7 @@ class Karma(Module):
Module.__init__(self, irc, config, server)
pattern = "(?:(\S+)|\((.+)\))"
pattern = "(?:\((.+)\)|(\S+))"
karmapattern = pattern + '(\+\+|--|\+-|-\+)' + '(\s+|$)'
querypattern = '^!rank\s+(.*)'
reportpattern = '^!karma\s+report\s+(highest|lowest|positive|negative|top)'