(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:
parent
d550a62fe3
commit
44f798c9bf
|
@ -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(
|
||||||
|
|
Loading…
Reference in New Issue