PCRE2_SET_DEPTH_LIMIT(3)

okay so buckle up bestie 🫢 β€” this page lives in the Library Functions Manual for PCRE2, and the star of the show is PCRE2_SET_DEPTH_LIMIT(3). It’s short, it’s cute, it still ate πŸ’….

🌸 NAME 🌸

PCRE2 - Perl-compatible regular expressions (revised API). That’s the name, that’s the vibe: revised-API main character energy, no cap πŸ‘‘.

✨ SYNOPSIS ✨

       #include <pcre2.h>

       int pcre2_set_depth_limit(pcre2_match_context *mcontext,
         uint32_t value);

πŸ’… DESCRIPTION πŸ’…

Okay so here’s the literal tea β˜•: this function sets the backtracking depth limit field in a match context. That’s the whole job. You hand it a pcre2_match_context *mcontext and a uint32_t value, and it sets that field. The result is always zero. Always. Zero. Not a maybe-zero, not a sometimes-zero β€” always zero πŸ’€.

If you want the full lore, 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 for the deep dive, iykyk πŸ“šβœ¨.


that’s it, bestie πŸŽ€ β€” this page is serving PCRE2 10.47, dated 25 March 2017. mwah, go set those depth limits and slay πŸ’–

πŸ“¦ where this page comes from