Filtering Console Output with Regular Expressions
If basic text matching is not flexible enough to capture varied console lines, Console Filter Mod allows you to define pattern-based rules using standard Java-style regular expressions.
Setting Up regexFilters
1. Open the mod configuration file.
2. Locate the regexFilters setting.
3. Add your target regex patterns enclosed in quotation marks inside the array brackets.
For example, to match and suppress common server warnings matching specific text patterns anywhere on a line, format the entry like this:
`regexFilters = [".*Can't keep up!.*", ".*Player moved too quickly!.*"]
Formatting Regex Rules
The mod evaluates console output using Java-style regular expressions. Because lines typically include timestamps, log levels, or thread names before the actual warning text, you will generally want to use wildcard patterns such as .* at the start and end of your pattern so the filter matches the complete line.
When writing your patterns, remember that backslashes must be escaped in the configuration file. For instance, to match whitespace characters, you must write \\s instead of an unescaped single slash. Save your changes and restart to apply the updated expressions.