Here you can find the source of isIPv6Address(String _ipAddress)
Parameter | Description |
---|---|
_ipAddress | a parameter |
public static boolean isIPv6Address(String _ipAddress)
//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(); } }