PCRE2_SET_...ERN_LENGTH(3)
π NAME π
PCRE2 - Perl-compatible regular expressions (revised API) π
Okay bestie, this is the PCRE2_SET_...ERN_LENGTH(3) page from the PCRE2 Library Functions Manual β yes, the title has that whole ... situation going on, but that's literally the name, iykyk π«Ά.
β¨ SYNOPSIS β¨
#include <pcre2.h>
int pcre2_set_max_pattern_length(pcre2_compile_context *ccontext,
PCRE2_SIZE value);
π DESCRIPTION π
So pcre2_set_max_pattern_length() sets, in a compile context, the maximum text length β measured in code units β of the pattern that can be compiled. The result is always zero. No cap, no drama, just 0 π
.
If a longer pattern is passed to pcre2_compile(), boom: there is an immediate error return π. The default is effectively unlimited, being the largest value a PCRE2_SIZE variable can hold β so it's basically βgo off until the type itself runs out of roomβ β¨.
Not me setting a max pattern length and then immediately passing a longer one to pcre2_compile()... that's an immediate error return, bestie ππ.
For the full tea: 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 π§π.
Cute little sign-off: this iconic page is from PCRE2 10.47, dated 05 October 2016, and its title is PCRE2_SET_...ERN_LENGTH(3) ππ. Periodt.
π¦ where this page comes from
- fedora 43: pcre2-devel 10.47-1.fc43 Β· BSD-3-Clause AND FSFULLR AND X11 AND GPL-2.0-or-later AND FSFAP AND FSFUL AND GPL-3.0-or-later
- fedora 43: pcre2-devel 10.47-1.fc43 Β· BSD-3-Clause AND FSFULLR AND X11 AND GPL-2.0-or-later AND FSFAP AND FSFUL AND GPL-3.0-or-later
- fedora 44: pcre2-devel 10.47-1.fc44.1 Β· BSD-3-Clause AND FSFULLR AND X11 AND GPL-2.0-or-later AND FSFAP AND FSFUL AND GPL-3.0-or-later
- fedora 44: pcre2-devel 10.47-1.fc44.1 Β· BSD-3-Clause AND FSFULLR AND X11 AND GPL-2.0-or-later AND FSFAP AND FSFUL AND GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms