public static boolean matchesIpAddress(final String pattern, final String remoteAddr) {
        try {
            val ipAddressMatcher = new IpAddressMatcher(pattern);
            LOGGER.trace("Attempting to match [{}] against [{}] as a IP or netmask", remoteAddr, pattern);
            return ipAddressMatcher.matches(remoteAddr);
        } catch (final Exception e) {
            LOGGER.trace("Falling back to regex match. Couldn't treat [{}] as an IP address or netmask: [{}]", pattern, e.getMessage());
            return find(pattern, remoteAddr);
        }
    }
Matches ip address.

@param pattern    the pattern
@param remoteAddr the remote addr
@return true or false
core/cas-server-core-util-api/src/main/java/org/apereo/cas/util/RegexUtils.java