PCRE2_MATCH_CONTEXT_COPY(3)

okay bestie, this is the PCRE2_MATCH_CONTEXT_COPY(3) page from the Library Functions Manual, and we’re gonna get you all caught up. no cap, it’s short and iconic βœ¨πŸ’…

πŸ’– NAME πŸ’–

PCRE2 - Perl-compatible regular expressions (revised API) πŸ¦‹

This is the pcre2_match_context_copy(3) moment, fr fr. If you’re in the Library Functions Manual and you need the deets on copying a match context, you’re literally in the right place πŸ’–

✨ SYNOPSIS ✨

okay so first things first, you gotta pull in the header, bestie:

       #include <pcre2.h>

and then the function itself is giving this signature:

       pcre2_match_context *pcre2_match_context_copy(
         pcre2_match_context *mcontext);

That’s the whole vibe: pcre2_match_context_copy() takes a pcre2_match_context *mcontext and hands you back a pcre2_match_context * πŸ’…

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so here’s the tea β˜•: this function makes a new copy of a match context, using the memory allocation function that was used for the original context. That’s it, that’s the main character move ✨

The result is NULL if the memory cannot be obtained β€” so if the memory fairy says no, you get NULL, no cap 😭

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, iykyk πŸ“šπŸ’–


signed, sealed, and serving looks: PCRE2 10.47 🌸, dated 25 October 2014 🫢✨

πŸ“¦ where this page comes from