Made regex less greedy

master
Keith Irwin 2017-08-31 18:19:19 +00:00
parent daf26dce13
commit 404956ef89
No known key found for this signature in database
GPG Key ID: 378933C743E2BBC0
1 changed files with 1 additions and 1 deletions

View File

@ -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