IP_REGEX - match whole string

This commit is contained in:
Dietmar Maurer 2020-04-19 07:55:40 +02:00
parent c45c291f18
commit 6fba9bf0bf

View File

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