protected boolean isMaskOptional(String mask) {
        return mask.contains("[") || mask.contains("]");
    }
Checks if the given mask string contains any optional mask characters.
In this context, an optional mask character is defined as either '[' or ']'.

@param mask the mask string to check
@return {@code true} if the mask contains either '[' or ']'; {@code false} otherwise
primefaces/src/main/java/org/primefaces/component/inputmask/InputMaskRenderer.java