hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1406205 - /httpcomponents/httpclient/branches/4.2.x/httpclient/src/main/java/org/apache/http/conn/util/InetAddressUtils.java
Date Tue, 06 Nov 2012 16:18:18 GMT
Author: olegk
Date: Tue Nov  6 16:18:17 2012
New Revision: 1406205

URL: http://svn.apache.org/viewvc?rev=1406205&view=rev
Log:
(Hopefully) a better regex for IPv4 address format

Modified:
    httpcomponents/httpclient/branches/4.2.x/httpclient/src/main/java/org/apache/http/conn/util/InetAddressUtils.java

Modified: httpcomponents/httpclient/branches/4.2.x/httpclient/src/main/java/org/apache/http/conn/util/InetAddressUtils.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/branches/4.2.x/httpclient/src/main/java/org/apache/http/conn/util/InetAddressUtils.java?rev=1406205&r1=1406204&r2=1406205&view=diff
==============================================================================
--- httpcomponents/httpclient/branches/4.2.x/httpclient/src/main/java/org/apache/http/conn/util/InetAddressUtils.java
(original)
+++ httpcomponents/httpclient/branches/4.2.x/httpclient/src/main/java/org/apache/http/conn/util/InetAddressUtils.java
Tue Nov  6 16:18:17 2012
@@ -44,7 +44,7 @@ public class InetAddressUtils {
 
     private static final Pattern IPV4_PATTERN =
         Pattern.compile(
-                "^(25[0-5]|2[0-4]\\d|[0-1]?\\d?\\d)(\\.(25[0-5]|2[0-4]\\d|[0-1]?\\d?\\d)){3}$");
+                "^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$");
 
     private static final Pattern IPV6_STD_PATTERN =
         Pattern.compile(



Mime
View raw message