diff --git a/CHANGELOG b/CHANGELOG index 83742b46..c530e393 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -2,6 +2,8 @@ Changes in 3.9.3: - Bundle Java 21 with Windows and Mac builds - Updated SWT for all platforms, improved loading of correct SWT library on Linux - Add support for plugin jars containing their own messages.properties +- Recognition of FQDNs (with trailing dots and numbers in TLDs) in IP list files +- Recognition of IPv6 addresses in IP list files - The UDP pinger now uses the same port as traceroute programs. - Switch from the legacy Date API to Java's new Time API - Time is now specified in 24-hour format in XML export diff --git a/src/net/azib/ipscan/util/InetAddressUtils.java b/src/net/azib/ipscan/util/InetAddressUtils.java index 3f5ab545..80b2d131 100644 --- a/src/net/azib/ipscan/util/InetAddressUtils.java +++ b/src/net/azib/ipscan/util/InetAddressUtils.java @@ -30,8 +30,7 @@ public class InetAddressUtils { static final Logger LOG = LoggerFactory.getLogger(); - // Warning! IPv4 specific code - public static final Pattern HOSTNAME_REGEX = Pattern.compile("\\b((([a-z]|[a-z0-9][a-z0-9\\-]*[a-z0-9])\\.)+([a-z]{2,})|\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3})\\b", CASE_INSENSITIVE); + public static final Pattern HOSTNAME_REGEX = Pattern.compile("(\\b(((?!25?[6-9])[12]\\d|[1-9])?\\d\\.?\\b){4}\\b)|(?