From 404956ef894500fa3ecf3537457a456b9d7c3553 Mon Sep 17 00:00:00 2001 From: Keith Irwin Date: Thu, 31 Aug 2017 18:19:19 +0000 Subject: [PATCH] Made regex less greedy --- main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.py b/main.py index 8ef6697..a109c8a 100644 --- a/main.py +++ b/main.py @@ -13,7 +13,7 @@ sub = reddit.subreddit('IsAnybodyHere') for comment in rall.stream.comments(): # Match with regex - match = re.search("(does|has|is)(n't)? (any one|anyone|someone|anybody) (here)? (.*)\?", comment.body, re.IGNORECASE) + match = re.search("(does|has|is)(n't)? (any one|anyone|someone|anybody) (here)? (.*?)\?", comment.body, re.IGNORECASE) if match: # Extract a description of the needed person