shulker icon indicating copy to clipboard operation
shulker copied to clipboard

Help with Regex

Open sasha-volodin opened this issue 3 years ago • 10 comments

Hi! Help me pls. Earlier all working: latest.log: [21:39:48] [Async Chat Thread - #65/INFO]: <nickname> msg Regex: "REGEX_MATCH_CHAT_MC": "\\[Async Chat Thread - #\\d*\/INFO\\]: <([^>]*)> (.*)"

But, i change chat cfg: latest.log: [21:36:20] [Async Chat Thread - #64/INFO]: nickname: msg And now msg mc to dc not send. This regex not correct. Help me with regex pls for new chat cfg

sasha-volodin avatar Feb 25 '21 18:02 sasha-volodin

Anybody ?

sasha-volodin avatar Mar 01 '21 08:03 sasha-volodin

Can you send a line from the log enclosed with backticks (``` on both sides) to fix formatting?

destruc7i0n avatar Mar 05 '21 16:03 destruc7i0n

log from mine or ?

sasha-volodin avatar Mar 05 '21 16:03 sasha-volodin

Yeah your log line. In the GitHub editor, when pasting, first click on "Insert Code" in the comment box and then paste the line from your log.

destruc7i0n avatar Mar 07 '21 05:03 destruc7i0n

[22:06:21] [Async Chat Thread - #2/INFO]: sunlight: some msg

sasha-volodin avatar Mar 07 '21 06:03 sasha-volodin

Try this: ^([^:]*): (.*)

destruc7i0n avatar Mar 11 '21 21:03 destruc7i0n

not working (

sasha-volodin avatar Mar 15 '21 09:03 sasha-volodin

Oh I see you're still using REGEX_MATCH_CHAT_MC. I'd recommend updating to the latest version. If you cannot, for REGEX_MATCH_CHAT_MC, the regex would be \[Async Chat Thread - #\d*\/INFO\]: ([^:]*): (.*)

If this doesn't work as well, can you post your full config.json enclosed with the "`" character?

destruc7i0n avatar Mar 15 '21 16:03 destruc7i0n

Doesn't work. Config: ` "PORT": 8000,

"USE_WEBHOOKS": true,
"WEBHOOK_URL": "",
"DISCORD_TOKEN": "",
"DISCORD_CHANNEL_ID": "",
"DISCORD_MESSAGE_TEMPLATE": "`%username%`: %message%",

"MINECRAFT_SERVER_RCON_IP": "127.0.0.1",
"MINECRAFT_SERVER_RCON_PORT": 25575,
"MINECRAFT_SERVER_RCON_PASSWORD": "",
"MINECRAFT_TELLRAW_TEMPLATE": "[{\"color\": \"white\", \"text\": \"<%username%> %message%\"}]",

"IS_LOCAL_FILE": true,
"LOCAL_FILE_PATH": "/home/server/logs/latest.log",

"ALLOW_USER_MENTIONS": false,

"WEBHOOK": "/minecraft/hook",
"REGEX_MATCH_CHAT_MC": "\\[Async Chat Thread - #\\d*\/INFO\\]: <([^>]*)> (.*)",
 "REGEX_IGNORED_CHAT": "packets too frequently",
"RCON_RECONNECT_DELAY": 10,
"DEBUG": false`

sasha-volodin avatar Mar 16 '21 06:03 sasha-volodin

"REGEX_MATCH_CHAT_MC": "\\[Async Chat Thread - #\\d*\/INFO\\]: ([^:]*): (.*)",

This line should work based on the string you sent from my local testing, are you getting any other errors?

destruc7i0n avatar Mar 16 '21 21:03 destruc7i0n