Split out the non-anchored part, analogous to the other regexes defined in this crate - so they can be used in both ways (anchored and not anchored).
Signed-off-by: Stefan Hanreich <[email protected]> --- proxmox-ve-config/src/sdn/fabric/section_config/interface.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/proxmox-ve-config/src/sdn/fabric/section_config/interface.rs b/proxmox-ve-config/src/sdn/fabric/section_config/interface.rs index 4374f38..f0db8aa 100644 --- a/proxmox-ve-config/src/sdn/fabric/section_config/interface.rs +++ b/proxmox-ve-config/src/sdn/fabric/section_config/interface.rs @@ -1,9 +1,12 @@ +use const_format::concatcp; use serde::{Deserialize, Serialize}; use proxmox_schema::{api, api_string_type, const_regex, ApiStringFormat, UpdaterType}; +pub const INTERFACE_NAME_REGEX_STR: &str = "[[:ascii:]]+"; + const_regex! { - pub INTERFACE_NAME_REGEX = r"^[[:ascii:]]+$"; + pub INTERFACE_NAME_REGEX = concatcp!(r"^", INTERFACE_NAME_REGEX_STR, r"$"); } pub const INTERFACE_NAME_FORMAT: ApiStringFormat = ApiStringFormat::Pattern(&INTERFACE_NAME_REGEX); -- 2.47.3
