PCRE2_GET_MARK(3)

πŸ’– PCRE2_GET_MARK(3) πŸ’–

okay bestie, welcome to the Library Functions Manual page for the PCRE2 function pcre2_get_mark. it's giving "tiny function, important lore" energy, and we're gonna get through it together 🫢

πŸŽ€ NAME πŸŽ€

PCRE2 - Perl-compatible regular expressions (revised API)

✨ SYNOPSIS ✨

#include <pcre2.h>

PCRE2_SPTR pcre2_get_mark(pcre2_match_data *match_data);

πŸ’… DESCRIPTION πŸ’…

so picture this: you already called pcre2_match() and passed it the match block that is this function's argument. after that, pcre2_get_mark() returns a pointer to the last (*MARK), (*PRUNE), or (*THEN) name that was encountered during the matching process. yup, the last one, bestie. no cap.

the name is zero-terminated, and it lives inside the compiled pattern. the length of the name is in the preceding code unit β€” that's the little detail, don't forget it πŸ’…. if no name is available, NULL is returned.

after a successful match, the name that is returned is the last one on the matching path. after a failed match or a partial match, the last encountered name is returned. lowkey important distinction, okay?

there's 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 extended universe 🌈.


and that's the whole page, bestie πŸ’– it's PCRE2 10.47, dated 13 January 2018, and the page is literally PCRE2_GET_MARK(3). slay ✨

πŸ“¦ where this page comes from