private List<Command> getMatchingCommands(String arg) {
        List<Command> result = new ArrayList<Command>();
        for (Entry<String, Command> entry : commands.entrySet()) {
            if (arg.matches(entry.getKey())) {
                result.add(entry.getValue());
            }
        }
        
        return result;
    }