package com.bwfcwalshy.flarebot.permissions;

import java.util.function.Predicate;

public class PermissionNode implements Predicate<PermissionNode> {

    private final String node;

    public PermissionNode(String node) {
        this.node = node;
    }

    public String getNode() {
        return node;
    }

    @Override
    public boolean test(PermissionNode node) {
        String textNode = getNode().replace(".", "\\.").replace("*", ".*");
        return node.getNode().matches(textNode);
    }
}

@@ -60,26 +60,119 @@
 til.
-function.Predicate
+Arrays;%0Aimport java.util.function.Predicate;%0Aimport java.util.regex.Pattern;%0Aimport java.util.stream.Collectors
 ;%0A%0Ap
@@ -493,55 +493,165 @@
 e = 
-getNode().replace(%22.%22, %22%5C%5C.%22).replace(%22*%22, %22.*%22
+Arrays.stream(getNode().split(%22(?:%5E%5C%5C*(%5C%5C.))%7C(?:(?%3C=%5C%5C.)%5C%5C*(?=%5C%5C.))%22))%0A                .map(Pattern::quote)%0A                .collect(Collectors.joining(%22.+%22)
 );%0A 

Make permission nodes better again