@Override
    public Pattern deserialize(JsonParser parser, DeserializationContext context)
            throws IOException, JsonProcessingException {

        if (!parser.hasToken(JsonToken.VALUE_STRING))
            throw new JsonParseException(parser, "Regular expressions may only be represented as strings.");

        try {
            return Pattern.compile(parser.getText(), Pattern.CASE_INSENSITIVE);
        }
        catch (PatternSyntaxException e) {
            throw new JsonParseException(parser, "Invalid regular expression.", e);
        }

    }
Creates a new CaseInsensitivePatternDeserializer which deserializes
string values to Pattern objects with the case insensitive flag set.
extensions/guacamole-auth-ldap/src/main/java/org/apache/guacamole/auth/ldap/conf/CaseInsensitivePatternDeserializer.java