DOKK / manpages / debian 12 / libregexp-common-net-cidr-perl / Regexp::Common::net::CIDR.3pm.en
Regexp::Common::net::CIDR(3pm) User Contributed Perl Documentation Regexp::Common::net::CIDR(3pm)

Regexp::Common::net::CIDR -- provide patterns for CIDR blocks.

    use Regexp::Common ();
    use Regexp::Common::net::CIDR ();
    while (<>) {
        /$RE{net}{CIDR}{IPv4}/ and print "Contains a CIDR.\n";
    }

Patterns for CIDR blocks. Now only next IPv4 formats are supported:

  xxx.xxx/xx
  xxx.xxx.xxx/xx
  xxx.xxx.xxx.xxx/xx

With {-keep} stores address in $1 and number of bits in $2.

  perl Makefile.PL
  make
  make install

As Regexp::Common doesn't work well with extensions named "Regexp::Common::xxx::yyy" you have to load this extension yourself with "use" or "require".

Ruslan U. Zakirov <ruz@bestpractical.com>

2022-11-19 perl v5.36.0