PCRE_MAKETABLES(3)

πŸ’– PCRE_MAKETABLES πŸ’–

ok so this is a page from the Library Functions Manual, bestie β€” it's PCRE_MAKETABLES(3) and it's all about building character tables. yes, literally. let's go πŸ¦‹


✨ NAME ✨

PCRE β€” Perl-compatible regular expressions πŸ’…


✨ SYNOPSIS ✨

#include <pcre.h>

const unsigned char *pcre_maketables(void);

const unsigned char *pcre16_maketables(void);

const unsigned char *pcre32_maketables(void);

like. three whole functions. all of them taking zero arguments. iconic behaviour tbh πŸ‘‘


✨ DESCRIPTION ✨

okay so this function builds a set of character tables for character values less than 256. that's the whole gig. character values. under 256. slay πŸ’–

and what do you do with these tables?? you can pass them to pcre[16|32]_compile() to override PCRE's internal, built-in tables β€” which, fun fact, were made by pcre[16|32]_maketables() back when PCRE was compiled. so you're basically overriding the tables that were themselves made by the very same family of functions. generational. 🧚

when would you even want to do this?? if you are using a non-standard locale. that's the vibe check right there. non-standard locale = you might wanna swap in your own tables. periodt.

and the function yields a pointer to the tables. so you get a const unsigned char * back. don't lose it. πŸŽ€

ngl there is also a complete description of the PCRE native API in the pcreapi page, and a description of the POSIX API in the pcreposix page. go read those too bestie, they're right there πŸ“š

🌈 SEE ALSO 🌈

  • pcreapi β€” the complete description of the PCRE native API
  • pcreposix β€” the description of the POSIX API

ok that's the whole page, no cap. πŸ’œ

and for the cute sign-off: this lil masterpiece is from PCRE 8.30, dated 24 June 2012, and it lives in the Library Functions Manual β€” so shoutout to the manual page PCRE_MAKETABLES(3), we love her, we respect her, bye bestie 🫢🌸