private FieldValue getIpV4Address(final Condition condition, final String fieldName, final String value) {
        final Matcher ipAddressMatcher = IPV4_ADDRESS_PATTERN.matcher(value);
        try {
            if (ipAddressMatcher.matches()) {
                InetAddress.getByAddress(new byte[]{
                        Integer.valueOf(ipAddressMatcher.group(1)).byteValue(),
                        Integer.valueOf(ipAddressMatcher.group(2)).byteValue(),
                        Integer.valueOf(ipAddressMatcher.group(3)).byteValue(),
                        Integer.valueOf(ipAddressMatcher.group(4)).byteValue()
                });
            } else {
                throw new IllegalArgumentException();
            }
        } catch (Exception e) {
            throw new IllegalArgumentException("Invalid IPv4 address format: " + value + " for field \"" +
                    fieldName + "\"");
        }

        if (!condition.equals(Condition.EQUALS) && !condition.equals(Condition.IN) &&
                !condition.equals(Condition.IN_DICTIONARY) && IPV4_CIDR_PATTERN.matcher(value).matches()) {
            throw new IllegalArgumentException("CIDR notation is only supported for EQUALS and IN operators. " +
                    "Value provided: \"" + value + "\". Operator: \"" + condition.getDisplayValue() + "\"");
        }
        return FieldValue.of(value);
    }
Validates the format of an IPv4 address. CIDR notation is allowed (e.g. 192.168.1.1/24) for equality
conditions (EQUALS, IN and IN_DICTIONARY).
stroom-search/stroom-search-elastic/src/main/java/stroom/search/elastic/search/SearchExpressionQueryBuilder.java