@@ -413,6 +413,130 @@ Unacceptable input example:
413413/usr2/username/bin:/usr/local/bin:/usr/bin:.
414414` ` `
415415
416+ # ### `Stdlib::IP::Address`
417+
418+ Matches any IP address, including both IPv4 and IPv6 addresses. It will
419+ match them either with or without an address prefix as used in CIDR
420+ format IPv4 addresses.
421+
422+ Examples:
423+
424+ ```
425+ '127.0.0.1' =~ Stdlib::IP::Address # true
426+ '8.8.4.4' =~ Stdlib::IP::Address # true
427+ '10.1.240.4/24' =~ Stdlib::IP::Address # true
428+ '52.10.10.141' =~ Stdlib::IP::Address # true
429+ '192.168.1' =~ Stdlib::IP::Address # false
430+ 'FEDC:BA98:7654:3210:FEDC:BA98:7654:3210' =~ Stdlib::IP::Address # true
431+ 'FF01:0:0:0:0:0:0:101' =~ Stdlib::IP::Address # true
432+ 'FF01::101' =~ Stdlib::IP::Address # true
433+ 'FF01:0:0:0:0:0:0:101/32' =~ Stdlib::IP::Address # true
434+ 'FF01::101/60' =~ Stdlib::IP::Address # true
435+ '::' =~ Stdlib::IP::Address # true
436+ '12AB::CD30:192.168.0.1' =~ Stdlib::IP::Address # true
437+ ```
438+
439+ #### `Stdlib::IP::Address::V4`
440+
441+ Match any string consisting of an IPv4 address in the quad-dotted
442+ decimal format, with or without a CIDR prefix. It will not match any
443+ abbreviated form (e.g., 192.168.1) because these are poorly documented
444+ and inconsistently supported.
445+
446+ Examples:
447+
448+ ```
449+ '127.0.0.1' =~ Stdlib::IP::Address::V4 # true
450+ '8.8.4.4' =~ Stdlib::IP::Address::V4 # true
451+ '10.1.240.4/24' =~ Stdlib::IP::Address::V4 # true
452+ '52.10.10.141' =~ Stdlib::IP::Address::V4 # true
453+ '192.168.1' =~ Stdlib::IP::Address::V4 # false
454+ 'FEDC:BA98:7654:3210:FEDC:BA98:7654:3210' =~ Stdlib::IP::Address::V4 # false
455+ '12AB::CD30:192.168.0.1' =~ Stdlib::IP::Address::V4 # false
456+ ```
457+
458+ #### `Stdlib::IP::Address::V6`
459+
460+ Match any string consistenting of an IPv6 address in any of the
461+ documented formats in RFC 2373, with or without an address prefix.
462+
463+ Examples:
464+
465+ ```
466+ '127.0.0.1' =~ Stdlib::IP::Address::V6 # false
467+ '10.1.240.4/24' =~ Stdlib::IP::Address::V6 # true
468+ 'FEDC:BA98:7654:3210:FEDC:BA98:7654:3210' =~ Stdlib::IP::Address::V6 # true
469+ 'FF01:0:0:0:0:0:0:101' =~ Stdlib::IP::Address::V6 # true
470+ 'FF01::101' =~ Stdlib::IP::Address::V6 # true
471+ 'FF01:0:0:0:0:0:0:101/32' =~ Stdlib::IP::Address::V6 # true
472+ 'FF01::101/60' =~ Stdlib::IP::Address::V6 # true
473+ '::' =~ Stdlib::IP::Address::V6 # true
474+ '12AB::CD30:192.168.0.1' =~ Stdlib::IP::Address::V6 # true
475+ ```
476+
477+ #### `Stdlib::IP::Address::Nosubnet`
478+
479+ Match the same things as the `Stdlib::IP::Address` alias, except it will not
480+ match an address that includes an address prefix (e.g., it will match
481+ `192.168.0.6` but not `192.168.0.6/24`).
482+
483+ #### `Stdlib::IP::Address::V4::CIDR`
484+
485+ Match an IPv4 address in the CIDR format. It will only match if the
486+ address contains an address prefix (e.g., it will match `192.168.0.6/24`
487+ but not `192.168.0.6`).
488+
489+ #### `Stdlib::IP::Address::V4::Nosubnet`
490+
491+ Match an IPv4 address only if the address does not contain an address
492+ prefix (e.g., it will match `192.168.0.6` but not `192.168.0.6/24`).
493+
494+ #### `Stdlib::IP::Address::V6::Full`
495+
496+ Match an IPv6 address formatted in the "preferred form" as documented in
497+ section 2.2.1 of RFC 2373, with or without an address prefix as
498+ documented in section 2.3 of RFC 2373.
499+
500+ #### `Stdlib::IP::Address::V6::Alternate`
501+
502+ Match an IPv6 address formatted in the "alternative form" allowing for
503+ representing the last two 16-bit pieces of the address with a
504+ quad-dotted decimal, as documented in section 2.2.1 of RFC 2373. It will
505+ match addresses with or without an address prefix as documented in
506+ section 2.3 of RFC 2373.
507+
508+ #### `Stdlib::IP::Address::V6::Compressed`
509+
510+ Match an IPv6 address which may contain `::` used to compress zeros as
511+ documented in section 2.2.2 of RFC 2373. It will match addresses with
512+ or without an address prefix as documented in section 2.3 of RFC 2373.
513+
514+ #### `Stdlib::IP::Address::V6::Nosubnet`
515+
516+ Alias to allow `Stdlib::IP::Address::V6::Nosubnet::Full`,
517+ `Stdlib::IP::Address::V6::Nosubnet::Alternate` and
518+ `Stdlib::IP::Address::V6::Nosubnet::Compressed`.
519+
520+ #### `Stdlib::IP::Address::V6::Nosubnet::Full`
521+
522+ Match an IPv6 address formatted in the "preferred form" as documented in
523+ section 2.2.1 of RFC 2373. It will not match addresses with address
524+ prefix as documented in section 2.3 of RFC 2373.
525+
526+ #### `Stdlib::IP::Address::V6::Nosubnet::Alternate`
527+
528+ Match an IPv6 address formatted in the "alternative form" allowing for
529+ representing the last two 16-bit pieces of the address with a
530+ quad-dotted decimal, as documented in section 2.2.1 of RFC 2373. It will
531+ only match addresses without an address prefix as documented in section
532+ 2.3 of RFC 2373.
533+
534+ #### `Stdlib::IP::Address::V6::Nosubnet::Compressed`
535+
536+ Match an IPv6 address which may contain `::` used to compress zeros as
537+ documented in section 2.2.2 of RFC 2373. It will only match addresses
538+ without an address prefix as documented in section 2.3 of RFC 2373.
539+
416540### Facts
417541
418542#### `package_provider`
0 commit comments