PCRE2_MAKETABLES(3)

πŸ’– NAME πŸ’–

okay so this is the PCRE2_MAKETABLES(3) page in the Library Functions Manual β€” hi bestie, welcome to the PCRE2 library πŸ’…

  • PCRE2 β€” Perl-compatible regular expressions (revised API)

✨ SYNOPSIS ✨

#include <pcre2.h>

const uint8_t *pcre2_maketables(pcre2_general_context *gcontext);

πŸŽ€ DESCRIPTION πŸŽ€

So the way that pcre2_maketables() works is: it builds a set of character tables for character code points that are less than 256. That's the assignment, and it ate, no cap β€” lowkey iconic. 🫢

These tables can be passed to pcre2_compile() in a compile context in order to override the internal, built-in tables β€” the ones that were either defaulted or made by pcre2_maketables() when PCRE2 was compiled. See the pcre2_set_character_tables() page. You might want to do this if you are using a non-standard locale β€” it's giving custom-locale energy, and highkey slay. 🌈

Now for the argument energy: if the argument is NULL, malloc() is used to get memory for the tables. Otherwise it must point to a general context, which can supply pointers to a custom memory manager. The function yields a pointer to the tables. Vibe check: pointer to tables, periodt β€” ngl, that's main character energy πŸ’–

Also, there is a complete description of the PCRE2 native API in the pcre2api page and a description of the POSIX API in the pcre2posix page. Go read those if you want the full lore ✨

I'm literally obsessed with how this whole page is just one function, fr fr. πŸ¦‹


Signing off from the PCRE2_MAKETABLES(3) page: this one is from PCRE2 10.47, dated 26 February 2025 β€” mwah, bestie πŸ’‹πŸŽ€

πŸ“¦ where this page comes from