Java IP Address Validate isIPv6Address(String _ipAddress)

Here you can find the source of isIPv6Address(String _ipAddress)

Description

Checks if given String is an IPv6 address.

License

Open Source License

Parameter

Parameter Description
_ipAddress a parameter

Return

true if valid address, false otherwise

Declaration

public static boolean isIPv6Address(String _ipAddress) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.regex.Pattern;

public class Main {
    private static final Pattern IPV6_PATTERN = Pattern.compile("([0-9a-f]{1,4}:){7}([0-9a-f]){1,4}",
            Pattern.CASE_INSENSITIVE);

    /**//from  w  w w. jav  a2s  .c  om
     * Checks if given String is an IPv6 address.
     *
     * @param _ipAddress
     * @return true if valid address, false otherwise
     */
    public static boolean isIPv6Address(String _ipAddress) {
        return IPV6_PATTERN.matcher(_ipAddress).matches();
    }
}

Related

  1. isIPv6(final String ip)
  2. isIPv6(String address)
  3. isIpV6Address(CharSequence address)
  4. isIPv6Address(final String input)
  5. isIPv6Address(final String input)
  6. isIPv6HexCompressedAddress(final String input)
  7. isIPv6HexCompressedAddress(final String input)
  8. isIPv6HexCompressedAddress(String ip)
  9. isIPv6LiteralAddress(String src)