From 6fba9bf0bf8a6b4949ea68a0731c26d69632f107 Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Sun, 19 Apr 2020 07:55:40 +0200 Subject: [PATCH] IP_REGEX - match whole string --- proxmox/src/tools/common_regex.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proxmox/src/tools/common_regex.rs b/proxmox/src/tools/common_regex.rs index 0841a9bb..82d46f01 100644 --- a/proxmox/src/tools/common_regex.rs +++ b/proxmox/src/tools/common_regex.rs @@ -41,7 +41,7 @@ macro_rules! IPV6RE { () => (concat!(r"(?:", macro_rules! IPRE { () => (concat!(r"(?:", IPV4RE!(), "|", IPV6RE!(), ")")) } lazy_static! { - pub static ref IP_REGEX: Regex = Regex::new(IPRE!()).unwrap(); + pub static ref IP_REGEX: Regex = Regex::new(concat!(r"^", IPRE!(), r"$")).unwrap(); pub static ref SHA256_HEX_REGEX: Regex = Regex::new(r"^[a-f0-9]{64}$").unwrap(); pub static ref SYSTEMD_DATETIME_REGEX: Regex = Regex::new(r"^\d{4}-\d{2}-\d{2}( \d{2}:\d{2}(:\d{2})?)?$").unwrap();