From c29390b4dc594b7810150c030e1bddf6182a3958 Mon Sep 17 00:00:00 2001 From: Sebastian Bazley Date: Mon, 11 Feb 2013 20:19:56 +0000 Subject: [PATCH] Remove single trailing space (checkstyle is rather fierce!) git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1444943 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/org/apache/http/conn/util/InetAddressUtils.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/httpclient/src/main/java/org/apache/http/conn/util/InetAddressUtils.java b/httpclient/src/main/java/org/apache/http/conn/util/InetAddressUtils.java index 4df8168f5..06f5e8bf0 100644 --- a/httpclient/src/main/java/org/apache/http/conn/util/InetAddressUtils.java +++ b/httpclient/src/main/java/org/apache/http/conn/util/InetAddressUtils.java @@ -42,7 +42,7 @@ public class InetAddressUtils { private InetAddressUtils() { } - private static final String IPV4_BASIC_PATTERN_STRING = + private static final String IPV4_BASIC_PATTERN_STRING = "(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}" + // initial 3 fields, 0-255 followed by . "([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])"; // final field, 0-255 @@ -54,11 +54,11 @@ public class InetAddressUtils { private static final Pattern IPV6_STD_PATTERN = Pattern.compile( - "^([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}$"); + "^[0-9a-fA-F]{1,4}(:[0-9a-fA-F]{1,4}){7}$"); private static final Pattern IPV6_HEX_COMPRESSED_PATTERN = Pattern.compile( - "^(([0-9A-Fa-f]{1,4}(:[0-9A-Fa-f]{1,4})*)?)::(([0-9A-Fa-f]{1,4}(:[0-9A-Fa-f]{1,4})*)?)$"); + "^(([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})?)$"); public static boolean isIPv4Address(final String input) { return IPV4_PATTERN.matcher(input).matches();