From 381d5f35ba3e9c7b542168688e266db9c3738f87 Mon Sep 17 00:00:00 2001 From: chr Date: Fri, 3 Apr 2020 06:39:22 +0000 Subject: [PATCH] fix regex --- wrapper.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wrapper.py b/wrapper.py index 42f27ac..fc344f6 100644 --- a/wrapper.py +++ b/wrapper.py @@ -46,9 +46,9 @@ def send_process_output( # "[07:36:28] [Server thread/INFO] [minecraft/DedicatedServer]: test" chat_pattern = re.compile(r"(\[.*\] )?\[(.*)\] \[(.*)\]: <(.*)> (.*)") # "[05:09:54] [Server thread/INFO] [minecraft/DedicatedServer]: khr_ joined the game" - login_pattern = re.compile(r"\[.*\] \[(.*)\] \[(.*)\]: ([^ ]*]) joined the game") + login_pattern = re.compile(r"\[.*\] \[(.*)\] \[(.*)\]: (\S*) joined the game") # "[05:12:24] [Server thread/INFO] [minecraft/DedicatedServer]: khr_ left the game" - logout_pattern = re.compile(r"\[.*\] \[(.*)\] \[(.*)\]: ([^ ]*]) left the game") + logout_pattern = re.compile(r"\[.*\] \[(.*)\] \[(.*)\]: (\S*) left the game") for line in process: log.info(line.rstrip("\n")) chat_result = chat_pattern.search(line)