From 54307e600bbbd3949e0f37556a895498403d5633 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Sat, 26 Oct 2019 11:53:29 -0700 Subject: [PATCH] Fix matching at not beginning of string --- bot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bot.py b/bot.py index 831e343..b0da137 100644 --- a/bot.py +++ b/bot.py @@ -320,7 +320,7 @@ def msg_ping(match: Match[str]) -> Response: @handle_message(r'.*\b(nano|linux|windows|emacs)\b', flags=re.IGNORECASE) def msg_gnu_please(match: Match[str]) -> Response: msg, word = match[3], match[4] - query = re.match(f'gnu[/+]{word}', msg, flags=re.IGNORECASE) + query = re.search(f'gnu[/+]{word}', msg, flags=re.IGNORECASE) if query: return MessageResponse(match, f'YES! {query[0]}') else: