Minecraft-Console-Client icon indicating copy to clipboard operation
Minecraft-Console-Client copied to clipboard

[BUG] Invalid escape sequence error while trying to apply config with chatfilter regex to catch '[' or ']'

Open nyghtwulf opened this issue 2 years ago • 0 comments

Prerequisites

  • [X] I made sure I am running the latest development build
  • [X] I tried to look for similar issues before opening a new one
  • [X] I have set debugmessages=true in config to diagnose my issue
  • [X] I have redacted session tokens and passwords before attaching screenshots

Minecraft Version

1.20.1

Console Client Version

Latest

Expected Behavior

I'm trying to set a chatfilter regex to filter out a bunch of noise/notification pings, following various regex for .net as per documentation, MCC refuses to start with an 'invalid escape sequence' error.

Actual Behavior

Found an invalid escape sequence '\120' on line 82

The contents of that line is as follows: ChatFilterRegex = "\n\x5BNews!\x5D.*"

I have also tried [ ] to match the brackets, as well as specifying their ascii, hex and octal variants and character class identifiers, all produce a variant of the error above with a different numeral for the noted invalid escape sequence. For example..

"\n\WPoints News!\W.*" produces "Found an invalid escape sequence '\87' on line 82"

It appears as if the filter is taking the first character after a \ and expanding it to a decimal format and breaking. Or internally its injecting an extra \ ?

I've been building the regex I want to use with RegexBuddy and testing it against client log files with cat|grep and it appears to work fine there.

Steps to Reproduce the bug

  1. Set a chat filter regex as noted above with escapes to match '[' and ']' charcters
  2. Start MCC
  3. MCC fails to start with 'invalid escape sequence' error.

Attach screenshot here (If applicable)

No response

Anythings that could help diagnosing the bug

No response

Device

Other

Operating System

Linux

Server Address (If applicable)

No response

nyghtwulf avatar Aug 25 '23 00:08 nyghtwulf