mirror of
https://github.com/ViaVersion/ViaVersion.git
synced 2024-11-02 08:39:59 +01:00
Ensure normal keys that end with numbers dont get matched and replaced
This commit is contained in:
parent
37170a2180
commit
a4920a2c74
@ -9,7 +9,7 @@ import us.myles.ViaVersion.api.data.UserConnection;
|
|||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
public class ChatItemRewriter {
|
public class ChatItemRewriter {
|
||||||
private static final Pattern indexRemoval = Pattern.compile("\\d+:(?=([^\"\\\\]*(\\\\.|\"([^\"\\\\]*\\\\.)*[^\"\\\\]*\"))*[^\"]*$)");
|
private static final Pattern indexRemoval = Pattern.compile("(?<![\\w-.+])\\d+:(?=([^\"\\\\]*(\\\\.|\"([^\"\\\\]*\\\\.)*[^\"\\\\]*\"))*[^\"]*$)");
|
||||||
// Taken from https://stackoverflow.com/questions/6462578/alternative-to-regex-match-all-instances-not-inside-quotes
|
// Taken from https://stackoverflow.com/questions/6462578/alternative-to-regex-match-all-instances-not-inside-quotes
|
||||||
|
|
||||||
public static void toClient(JsonElement element, UserConnection user) {
|
public static void toClient(JsonElement element, UserConnection user) {
|
||||||
|
Loading…
Reference in New Issue
Block a user