Show repeated string in compressed pattern
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1445026 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
cd1ac109d3
commit
f4c45c1e6f
|
@ -58,7 +58,9 @@ public class InetAddressUtils {
|
|||
|
||||
private static final Pattern IPV6_HEX_COMPRESSED_PATTERN =
|
||||
Pattern.compile(
|
||||
"^(([0-9A-Fa-f]{1,4}(:[0-9A-Fa-f]{1,4}){0,5})?)::(([0-9A-Fa-f]{1,4}(:[0-9A-Fa-f]{1,4}){0,5})?)$");
|
||||
"^(([0-9A-Fa-f]{1,4}(:[0-9A-Fa-f]{1,4}){0,5})?)" + // 0-6 hex fields
|
||||
"::" +
|
||||
"(([0-9A-Fa-f]{1,4}(:[0-9A-Fa-f]{1,4}){0,5})?)$"); // 0-6 hex fields
|
||||
|
||||
public static boolean isIPv4Address(final String input) {
|
||||
return IPV4_PATTERN.matcher(input).matches();
|
||||
|
|
Loading…
Reference in New Issue