+#[rustfmt::skip]
+const IPV4OCTET: &str = r"(?:25[0-5]|(?:2[0-4]|1[0-9]|[1-9])?[0-9])";
+
+#[rustfmt::skip]
+const IPV6H16: &str = r"(?:[0-9a-fA-F]{1,4})";
+
+/// Returns the regular expression string to match IPv4 addresses
+#[rustfmt::skip]
+pub const IPV4RE_STR: &str = concatcp!(r"(?:(?:", IPV4OCTET, r"\.){3}", IPV4OCTET, ")");
+
+#[rustfmt::skip]
+const IPV6LS32: &str = concatcp!(r"(?:(?:", IPV4RE_STR, "|", IPV6H16, ":", IPV6H16, "))" );
+
+/// Returns the regular expression string to match IPv6 addresses
+#[rustfmt::skip]
+pub const IPV6RE_STR: &str = concatcp!(r"(?:",
+ r"(?:(?:", r"(?:", IPV6H16, r":){6})", IPV6LS32, r")|",
+ r"(?:(?:", r"::(?:", IPV6H16, r":){5})", IPV6LS32, r")|",
+ r"(?:(?:(?:", IPV6H16, r")?::(?:", IPV6H16, r":){4})", IPV6LS32, r")|",
+ r"(?:(?:(?:(?:", IPV6H16, r":){0,1}", IPV6H16, r")?::(?:", IPV6H16, r":){3})", IPV6LS32, r")|",
+ r"(?:(?:(?:(?:", IPV6H16, r":){0,2}", IPV6H16, r")?::(?:", IPV6H16, r":){2})", IPV6LS32, r")|",
+ r"(?:(?:(?:(?:", IPV6H16, r":){0,3}", IPV6H16, r")?::(?:", IPV6H16, r":){1})", IPV6LS32, r")|",
+ r"(?:(?:(?:(?:", IPV6H16, r":){0,4}", IPV6H16, r")?::", ")", IPV6LS32, r")|",
+ r"(?:(?:(?:(?:", IPV6H16, r":){0,5}", IPV6H16, r")?::", ")", IPV6H16, r")|",
+ r"(?:(?:(?:(?:", IPV6H16, r":){0,6}", IPV6H16, r")?::", ")))");
+
+/// Returns the regular expression string to match IP addresses (v4 or v6)
+#[rustfmt::skip]
+pub const IPRE_STR: &str = concatcp!(r"(?:", IPV4RE_STR, "|", IPV6RE_STR, ")");
+
+/// Regular expression string to match IP addresses where IPv6 addresses require brackets around
+/// them, while for IPv4 they are forbidden.
+#[rustfmt::skip]
+pub const IPRE_BRACKET_STR: &str = concatcp!(r"(?:", IPV4RE_STR, r"|\[(?:", IPV6RE_STR, r")\]", r")");
+
+#[rustfmt::skip]
+pub const CIDR_V4_REGEX_STR: &str = concatcp!(r"(?:", IPV4RE_STR, r"/\d{1,2})$");
+
+#[rustfmt::skip]
+pub const CIDR_V6_REGEX_STR: &str = concatcp!(r"(?:", IPV6RE_STR, r"/\d{1,3})$");
+