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();