code: public static boolean isIPv4orIPv6Address(String _ipAddress) {
          return IPV4_PATTERN.matcher(_ipAddress).matches() || IPV6_PATTERN.matcher(_ipAddress).matches();
      }
docs: Checks if given String is either a valid IPv4 or IPv6 address.
  
  @param _ipAddress
  @return true if valid address, false otherwise