public String validateDataInSubfield(String pattern, String data) {
        String result = null;
        boolean found = false;
        String[] masks = pattern.split(",");
        for(int x = 0; x < masks.length; x++) {
            if(MarcWorxObjectHelper.equals(data, masks[x])) {
                found = true;
                break;
            }
        }
        if(!found) {
            StringBuilder sb = new StringBuilder();
            sb.append("Only");
            for(int x = 0; x < masks.length; x++) {
                if(x + 1 == masks.length) {
                    sb.append(" or");
                } else if (x > 0) {
                    sb.append(",");
                }
                sb.append(" \"").append(masks[x]).append("\"");
            }
            if(masks.length == 1) {
                sb.append(" is");
            } else {
                sb.append(" are");
            }
            sb.append(" allowed");
            result = sb.toString();
        }
        return result;
    }