]> git.proxmox.com Git - proxmox-backup.git/commitdiff
src/api2/types.rs: fix regex patterns
authorDietmar Maurer <dietmar@proxmox.com>
Mon, 13 Jan 2020 13:38:31 +0000 (14:38 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Mon, 13 Jan 2020 13:38:31 +0000 (14:38 +0100)
src/api2/types.rs

index 04905c662b44d51f365110e71d0521537824079a..73a63148a831cb954fcb0b6a5652182d4c0f7aa9 100644 (file)
@@ -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"$");
 }