From 095f61160ff2ee01fd4253593e2bc57b4555c368 Mon Sep 17 00:00:00 2001 From: hungtu Date: Fri, 15 Sep 2017 17:43:11 +0200 Subject: [PATCH] #102 Fix re.match to re.search --- rivescript/brain.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rivescript/brain.py b/rivescript/brain.py index 4426ff6..92ff619 100644 --- a/rivescript/brain.py +++ b/rivescript/brain.py @@ -376,7 +376,7 @@ def _getreply(self, user, msg, context='normal', step=0, ignore_object_errors=Tr bucket = [] for text in matched["reply"]: weight = 1 - match = re.match(RE.weight, text) + match = re.search(RE.weight, text) if match: weight = int(match.group(1)) if weight <= 0: