Java IP Address Validate isIPv6StdAddress(final String input)

Here you can find the source of isIPv6StdAddress(final String input)

Description

Checks whether the parameter is a valid standard (non-compressed) IPv6 address

License

Apache License

Parameter

Parameter Description
input the address string to check for validity

Return

true if the input parameter is a valid standard (non-compressed) IPv6 address

Declaration

public static boolean isIPv6StdAddress(final String input) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.util.regex.Pattern;

public class Main {
    private static final Pattern IPV6_STD_PATTERN = Pattern.compile("^[0-9a-fA-F]{1,4}(:[0-9a-fA-F]{1,4}){7}$");

    /**//  w ww  .  j  a v  a2 s. c  o m
     * Checks whether the parameter is a valid standard (non-compressed) IPv6 address
     *
     * @param input the address string to check for validity
     * @return true if the input parameter is a valid standard (non-compressed) IPv6 address
     */
    public static boolean isIPv6StdAddress(final String input) {
        return IPV6_STD_PATTERN.matcher(input).matches();
    }
}

Related

  1. isIPv6HexCompressedAddress(final String input)
  2. isIPv6HexCompressedAddress(final String input)
  3. isIPv6HexCompressedAddress(String ip)
  4. isIPv6LiteralAddress(String src)
  5. isIpV6RegexValid(String strIp)
  6. isIpValid(final String deviceIp)
  7. isIPValid(final String ipv4)
  8. isIpValid(String ip)