Regexp...t::CIDR(3pm)

πŸ“¦
version 0.03 Β· 5 versions
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– Regexp::Common::net::CIDR β€” the manual, but make it cute

okay bestie, gather round, because this one is Regexp::Common::net::CIDR (it lives in the Perl user-contributed docs, and the file is stylized as Regexp...t::CIDR(3pm) on the tin, iykyk). It's a lil extension that hands you patterns for CIDR blocks. That's the whole vibe. Short page, big energy. ✨


🌸 SYNOPSIS

use Regexp::Common ();
use Regexp::Common::net::CIDR ();

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

Like. That's it. You pull in Regexp::Common, you pull in this extension, and then $RE{net}{CIDR}{IPv4} does the heavy lifting while you sit there looking like the main character. πŸ‘‘


πŸ¦‹ DESCRIPTION

So this gives you patterns for CIDR blocks. Right now β€” and I need you to hear me when I say right now, because it's genuinely just these β€” only the following IPv4 formats are supported:

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

Three shapes. That's the menu. No extras, no secret bonus formats, don't come for me. πŸ’…

And here's the little treat: if you slap {-keep} on it, it stores the address in $1 and the number of bits in $2. Capture groups, but make them work for you. Obsessed. πŸŽ€


🧚 INSTALLATION

The classic three-step. You know it, you love it:

perl Makefile.PL
make
make install

Periodt. 🫢


πŸ’€ CAVEATS

okay so this is the part where you have to actually read, bestie, because it will bite you.

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

fr fr. It will not magically show up for you. You gotta use it or require it with your own two hands. Don't skip this step and then act surprised. 😭

πŸ’œ AUTHOR

Ruslan U. Zakirov <ruz@bestpractical.com>

Give them their flowers. 🌸


and that's the whole page, angel! πŸ’– this was documented by the Perl crew, running on perl v5.36.0, dated 2022-11-19, and yes the file still answers to Regexp...t::CIDR(3pm) because we don't deadname manpages in this house. go forth and match some CIDR blocks. slay. 🌈✨