(Hopefully) a better regex for IPv4 address format

git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1406216 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Oleg Kalnichevski 2012-11-06 16:49:24 +00:00
parent d550a62fe3
commit 44f798c9bf
1 changed files with 1 additions and 1 deletions

View File

@ -44,7 +44,7 @@ public class InetAddressUtils {
private static final Pattern IPV4_PATTERN = private static final Pattern IPV4_PATTERN =
Pattern.compile( 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 = private static final Pattern IPV6_STD_PATTERN =
Pattern.compile( Pattern.compile(