Regexp:...pressed(3)

πŸ“¦
version 0.02 Β· 2 versions
, in fedora 43

πŸ’– Regexp::Assemble::Compressed πŸ’–

okay bestie so this is a User Contributed Perl Documentation page, section 3 β€” aka the part of the manual where Perl people put their cool little libraries, and this one is literally called Regexp::Assemble::Compressed. no cap, the title is a whole mouthful, so let's get into it 🫢


✨ NAME ✨

Regexp::Assemble::Compressed β€” Assemble more compressed Regular Expression πŸ’…

like... it builds regexes. compressed ones. more of them. iconic behaviour, honestly.


🌸 SYNOPSIS 🌸

here's the vibe, copy-paste ready, character for character:

use Regexp::Assemble::Compressed;

my $ra = Regexp::Assemble::Compressed->new;
my @cctlds = qw(ma mc md me mf mg mh mk ml mm mn mo mp
                mq mr ms mt mu mv mw mx my mz);
for my $tld ( @cctlds ) {
    $ra->add( $tld );
}
print $ra->re; # prints m[ac-hk-z].
               # Regexp::Assemble prints m[acdefghklmnopqrstuvwxyz]

so you make a $ra, you feed it a whole list of country-code TLDs one by one with ->add, and then ->re hands you back the regex. and look at the output 😭 β€” this module gives you m[ac-hk-z]. while plain Regexp::Assemble gives you m[acdefghklmnopqrstuvwxyz]. same matching energy, way fewer characters. it's giving compression. it's giving efficiency. we love to see it ✨


πŸ’œ DESCRIPTION πŸ’œ

so Regexp::Assemble::Compressed is a subclass of Regexp::Assemble. πŸ¦‹

and what does it do? it assembles more compressed regular expressions. that's it, that's the whole thing. it inherits all the parent's energy and then squeezes the output even tighter. periodt. πŸ‘‘


πŸŽ€ AUTHOR πŸŽ€

Koichi Taniguchi <taniguchi@livedoor.jp> β€” thank you for your service, king πŸ«‘πŸ’–


🌈 LICENSE 🌈

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. 🧚

(so yes, go forth, remix, redistribute β€” just keep it on the same terms as Perl itself, that's the rule, no cap)


⭐ SEE ALSO ⭐

  • Regexp::Assemble β€” the parent class, the origin story, the blueprint. if you liked this one go read that one, iykyk πŸ’…

and that's the whole page bestie!! this one shipped as part of perl v5.42.0 and the page itself is dated 2025-07-25 🌸 so like, pretty recent, pretty fresh, pretty slay. go compress some regexes, you've got this πŸ¦‹πŸ’–βœ¨

πŸ“¦ where this page comes from