From ae62c4fe59fc1cc8973922043b95f92cdd0e5b88 Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Mon, 13 Jan 2020 14:38:31 +0100 Subject: [PATCH] src/api2/types.rs: fix regex patterns --- src/api2/types.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/api2/types.rs b/src/api2/types.rs index 04905c66..73a63148 100644 --- a/src/api2/types.rs +++ b/src/api2/types.rs @@ -23,7 +23,7 @@ macro_rules! DNS_NAME { () => (concat!(r"(?:", DNS_LABEL!() , r"\.)*", DNS_LABEL // colon separated lists)! // slash is not allowed because it is used as pve API delimiter // also see "man useradd" -macro_rules! USER_NAME_REGEX_STR { () => (r"(?:[^\s:/[[:cntrl:]]]+)") } +macro_rules! USER_NAME_REGEX_STR { () => (r"(?:[^\s:/[:cntrl:]]+)") } macro_rules! PROXMOX_SAFE_ID_REGEX_STR { () => (r"(?:[A-Za-z0-9_][A-Za-z0-9._\-]*)") } @@ -45,9 +45,9 @@ const_regex!{ pub HOSTNAME_REGEX = r"^(?:[a-zA-Z0-9](?:[a-zA-Z0-9\-]*[a-zA-Z0-9])?)$"; - pub DNS_NAME_REGEX = concat!(r"^", DNS_NAME!(), r")$"); + pub DNS_NAME_REGEX = concat!(r"^", DNS_NAME!(), r"$"); - pub DNS_NAME_OR_IP_REGEX = concat!(r"^", DNS_NAME!(), "|", IPRE!(), r")$"); + pub DNS_NAME_OR_IP_REGEX = concat!(r"^", DNS_NAME!(), "|", IPRE!(), r"$"); pub PROXMOX_USER_ID_REGEX = concat!(r"^", USER_NAME_REGEX_STR!(), r"@", PROXMOX_SAFE_ID_REGEX_STR!(), r"$"); }