Here you can find the source of isIPv6StdAddress(final String input)
Parameter | Description |
---|---|
input | the address string to check for validity |
public static boolean isIPv6StdAddress(final String input)
//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(); } }