1
0
Fork 0

fix regex

This commit is contained in:
khr 2020-04-03 06:39:22 +00:00
parent b48acdc688
commit 381d5f35ba
1 changed files with 2 additions and 2 deletions

View File

@ -46,9 +46,9 @@ def send_process_output(
# "[07:36:28] [Server thread/INFO] [minecraft/DedicatedServer]: <khr_> 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)