use re.search() rather than re.match() in a couple places
(search() looks for the regex anywhere in the string whereas match() only looks for the regex starting from the beginning)
This commit is contained in:
parent
b5e71d677f
commit
b7f2b9bd0e
@ -52,7 +52,7 @@ class Module(object):
|
||||
# setup regexp function in sqlite
|
||||
def regexp(expr, item):
|
||||
reg = re.compile(expr)
|
||||
return reg.match(item) is not None
|
||||
return reg.search(item) is not None
|
||||
self.conn.create_function('REGEXP', 2, regexp)
|
||||
|
||||
# set up database for this module
|
||||
|
@ -69,7 +69,7 @@ class Alias(Module):
|
||||
|
||||
for alias in alias_list:
|
||||
alias_re = re.compile(alias)
|
||||
if alias_re.match(what):
|
||||
if alias_re.search(what):
|
||||
command = re.sub(alias, self.config.get(self.__class__.__name__, alias), what)
|
||||
reply = self.try_recursion(connection, event, nick, userhost, None, command, admin_unlocked)
|
||||
if not reply == command:
|
||||
|
Loading…
Reference in New Issue
Block a user