From 0a999577c7005e76855b5acedc51fc4014cb7d24 Mon Sep 17 00:00:00 2001 From: David Kerr Date: Tue, 30 Jun 2020 13:29:10 -0400 Subject: [PATCH] Simplify the IPv4 regular expression --- ddclient.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ddclient.in b/ddclient.in index 2e2058d..9883d31 100755 --- a/ddclient.in +++ b/ddclient.in @@ -2342,7 +2342,7 @@ sub is_ipv4 { ## extract_ipv4() extracts the first valid IPv4 address from the given string ###################################################################### sub extract_ipv4 { - (shift // '') =~ /\b((?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?))\b/ai; + (shift // '') =~ /\b((?:(?25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?&octet))\b/a; return $1; }