module IpRegexes

Constants

IPV4_DEF

IPV4: Decimal IPv4, e.g. “1.2.3.4”, with lookahead (implemented in S4) at the end so that we don't match “192.168.1.123” in the string “192.168.1.1234”. */

IPV6V4_FULL

The same ones for IPv4-embedded notation, without the actual IPv4 part */

IPV6V4_LEFT
IPV6V4_MID
IPV6V4_RIGHT
IPV6_FULL
No

shorthand */

IPV6_LEFT
Begins with

*/

IPV6_MID

somewhere in the middle - use negative lookahead to make sure there aren't too many colons in total */

IPV6_NULL

Is “::” and nothing more */

IPV6_RIGHT
Ends with

*/

IP_DEF

IPV6: An IPv6 address (possibly with an embedded IPv4). This macro defines both IPV4 and IPV6, since the latter one requires the former. */

S4_DEF

S4: IPv4 segment (number between 0 and 255) with lookahead at the end so that we don't match “25” in the string “256”. The lookahead could go to the last segment of IPv4 only but this construct allows nicer unittesting. */

S6_DEF

IPv6, including embedded IPv4, e.g. “::1”, “dead:beef::1.2.3.4”. Lookahead for the next char not being a dot or digit, so it doesn't get stuck matching “dead:beef::1” in “dead:beef::1.2.3.4”. This is not required since the surrounding brackets would trigger backtracking, but it allows nicer unittesting. TODO: more strict check (right number of colons, etc.) TODO: add zone_id: RFC 4007 section 11, RFC 6874 */ S6: IPv6 segment, S6C: IPv6 segment followed by a comma, CS6: comma followed by an IPv6 segment */