PCRE2_SUBSTRING_FREE(3)

🌸 NAME 🌸

PCRE2 β€” literally Perl-compatible regular expressions, but make it the revised API ✨ (yes bestie, the glow-up edition πŸ’…)


πŸŽ€ SYNOPSIS πŸŽ€

#include <pcre2.h>

void pcre2_substring_free(PCRE2_UCHAR *buffer);

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so picture this: you've got a string, right? and it came from a previous call to pcre2_substring_get_byname() or pcre2_substring_get_bynumber(). that memory is yours, but like… it's not gonna free itself, bestie 😭. enter pcre2_substring_free() β€” the convenience function of your dreams πŸ’–. it exists purely to free that memory for you. one job. does it slay? yes.

her only argument is a pointer to the string β€” that's it, that's the whole vibe 🫢.

and here's the iconic part: if the argument is NULL, the function does nothing. no crash, no drama, no main character meltdown πŸ’€. it just peacefully minds its business. we love a low-maintenance function ✨.

there's a complete description of the PCRE2 native API hanging out in the pcre2api page, and if you're feeling the POSIX API instead, the pcre2posix page has you covered 🌈. go read them, iykyk πŸ‘‘


ngl, the one thing to remember: this is for strings that came from pcre2_substring_get_byname() or pcre2_substring_get_bynumber(). don't be out here freeing random pointers, that's not the vibe πŸ™ˆ.

and that's the whole page, bestie β€” short, sweet, and absolutely ate πŸ’… 🌸 πŸ¦‹ πŸ’œ

⭐ signed, sealed, delivered by PCRE2 10.47, dated 26 February 2025 ⭐ β€” see you in the next manpage, mwah πŸ˜˜πŸŽ€

πŸ“¦ where this page comes from