@@ -465,6 +465,130 @@ Unacceptable input example:
465465bob@example.com
466466` ` `
467467
468+ # ### `Stdlib::IP::Address`
469+
470+ Matches any IP address, including both IPv4 and IPv6 addresses. It will
471+ match them either with or without an address prefix as used in CIDR
472+ format IPv4 addresses.
473+
474+ Examples:
475+
476+ ```
477+ '127.0.0.1' =~ Stdlib::IP::Address # true
478+ '8.8.4.4' =~ Stdlib::IP::Address # true
479+ '10.1.240.4/24' =~ Stdlib::IP::Address # true
480+ '52.10.10.141' =~ Stdlib::IP::Address # true
481+ '192.168.1' =~ Stdlib::IP::Address # false
482+ 'FEDC:BA98:7654:3210:FEDC:BA98:7654:3210' =~ Stdlib::IP::Address # true
483+ 'FF01:0:0:0:0:0:0:101' =~ Stdlib::IP::Address # true
484+ 'FF01::101' =~ Stdlib::IP::Address # true
485+ 'FF01:0:0:0:0:0:0:101/32' =~ Stdlib::IP::Address # true
486+ 'FF01::101/60' =~ Stdlib::IP::Address # true
487+ '::' =~ Stdlib::IP::Address # true
488+ '12AB::CD30:192.168.0.1' =~ Stdlib::IP::Address # true
489+ ```
490+
491+ #### `Stdlib::IP::Address::V4`
492+
493+ Match any string consisting of an IPv4 address in the quad-dotted
494+ decimal format, with or without a CIDR prefix. It will not match any
495+ abbreviated form (e.g., 192.168.1) because these are poorly documented
496+ and inconsistently supported.
497+
498+ Examples:
499+
500+ ```
501+ '127.0.0.1' =~ Stdlib::IP::Address::V4 # true
502+ '8.8.4.4' =~ Stdlib::IP::Address::V4 # true
503+ '10.1.240.4/24' =~ Stdlib::IP::Address::V4 # true
504+ '52.10.10.141' =~ Stdlib::IP::Address::V4 # true
505+ '192.168.1' =~ Stdlib::IP::Address::V4 # false
506+ 'FEDC:BA98:7654:3210:FEDC:BA98:7654:3210' =~ Stdlib::IP::Address::V4 # false
507+ '12AB::CD30:192.168.0.1' =~ Stdlib::IP::Address::V4 # false
508+ ```
509+
510+ #### `Stdlib::IP::Address::V6`
511+
512+ Match any string consistenting of an IPv6 address in any of the
513+ documented formats in RFC 2373, with or without an address prefix.
514+
515+ Examples:
516+
517+ ```
518+ '127.0.0.1' =~ Stdlib::IP::Address::V6 # false
519+ '10.1.240.4/24' =~ Stdlib::IP::Address::V6 # true
520+ 'FEDC:BA98:7654:3210:FEDC:BA98:7654:3210' =~ Stdlib::IP::Address::V6 # true
521+ 'FF01:0:0:0:0:0:0:101' =~ Stdlib::IP::Address::V6 # true
522+ 'FF01::101' =~ Stdlib::IP::Address::V6 # true
523+ 'FF01:0:0:0:0:0:0:101/32' =~ Stdlib::IP::Address::V6 # true
524+ 'FF01::101/60' =~ Stdlib::IP::Address::V6 # true
525+ '::' =~ Stdlib::IP::Address::V6 # true
526+ '12AB::CD30:192.168.0.1' =~ Stdlib::IP::Address::V6 # true
527+ ```
528+
529+ #### `Stdlib::IP::Address::Nosubnet`
530+
531+ Match the same things as the `Stdlib::IP::Address` alias, except it will not
532+ match an address that includes an address prefix (e.g., it will match
533+ `192.168.0.6` but not `192.168.0.6/24`).
534+
535+ #### `Stdlib::IP::Address::V4::CIDR`
536+
537+ Match an IPv4 address in the CIDR format. It will only match if the
538+ address contains an address prefix (e.g., it will match `192.168.0.6/24`
539+ but not `192.168.0.6`).
540+
541+ #### `Stdlib::IP::Address::V4::Nosubnet`
542+
543+ Match an IPv4 address only if the address does not contain an address
544+ prefix (e.g., it will match `192.168.0.6` but not `192.168.0.6/24`).
545+
546+ #### `Stdlib::IP::Address::V6::Full`
547+
548+ Match an IPv6 address formatted in the "preferred form" as documented in
549+ section 2.2.1 of RFC 2373, with or without an address prefix as
550+ documented in section 2.3 of RFC 2373.
551+
552+ #### `Stdlib::IP::Address::V6::Alternate`
553+
554+ Match an IPv6 address formatted in the "alternative form" allowing for
555+ representing the last two 16-bit pieces of the address with a
556+ quad-dotted decimal, as documented in section 2.2.1 of RFC 2373. It will
557+ match addresses with or without an address prefix as documented in
558+ section 2.3 of RFC 2373.
559+
560+ #### `Stdlib::IP::Address::V6::Compressed`
561+
562+ Match an IPv6 address which may contain `::` used to compress zeros as
563+ documented in section 2.2.2 of RFC 2373. It will match addresses with
564+ or without an address prefix as documented in section 2.3 of RFC 2373.
565+
566+ #### `Stdlib::IP::Address::V6::Nosubnet`
567+
568+ Alias to allow `Stdlib::IP::Address::V6::Nosubnet::Full`,
569+ `Stdlib::IP::Address::V6::Nosubnet::Alternate` and
570+ `Stdlib::IP::Address::V6::Nosubnet::Compressed`.
571+
572+ #### `Stdlib::IP::Address::V6::Nosubnet::Full`
573+
574+ Match an IPv6 address formatted in the "preferred form" as documented in
575+ section 2.2.1 of RFC 2373. It will not match addresses with address
576+ prefix as documented in section 2.3 of RFC 2373.
577+
578+ #### `Stdlib::IP::Address::V6::Nosubnet::Alternate`
579+
580+ Match an IPv6 address formatted in the "alternative form" allowing for
581+ representing the last two 16-bit pieces of the address with a
582+ quad-dotted decimal, as documented in section 2.2.1 of RFC 2373. It will
583+ only match addresses without an address prefix as documented in section
584+ 2.3 of RFC 2373.
585+
586+ #### `Stdlib::IP::Address::V6::Nosubnet::Compressed`
587+
588+ Match an IPv6 address which may contain `::` used to compress zeros as
589+ documented in section 2.2.2 of RFC 2373. It will only match addresses
590+ without an address prefix as documented in section 2.3 of RFC 2373.
591+
468592### Facts
469593
470594#### `package_provider`
0 commit comments