count numeric OR non-alphanumeric as a word boundary

This commit is contained in:
jesopo 2019-08-16 15:33:34 +01:00
parent 94ef49be1b
commit 0b192d0feb

View file

@ -131,7 +131,7 @@ class Module(ModuleManager.BaseModule):
# will fire indefininitely.
continue
regex = re.compile(r"(.)\b(%s)(%s)" % (
regex = re.compile(r"([0-9]|\W)(%s)(%s)" % (
re.escape(user.nickname[0]), re.escape(user.nickname[1:])),
re.I)
s = regex.sub("\\1\\2\u200c\\3", s)