PCRE2_SET_NEWLINE(3)
π PCRE2_SET_NEWLINE(3)
okay so real quick before anything: this is a page from the PCRE2 library β that's Perl-compatible regular expressions (revised API) β and the manual name for it is PCRE2_SET_NEWLINE(3). Yes bestie the file is called one thing and the function inside is another, that's just how it is, we don't ask questions, we read the whole page π
β¨ SYNOPSIS β¨
like, first you gotta pull in the header, obviously:
#include <pcre2.h>
and then the actual function, and note the line break in the signature (it's two lines, not one β keep it cute, keep it exact):
int pcre2_set_max_varlookbehind(pcre2_compile_context *ccontext,
uint32_t value);
slay, that's it, that's the whole call π
πΈ DESCRIPTION πΈ
so what does it do? it sets a maximum length β as in, the max number of characters that a variable-length lookbehind assertion is allowed to match. that's the whole vibe check right there π₯
the default? it's set when PCRE2 is built, and the ultimate default is 255 β which is literally the same as Perl, no cap π
π«Ά heads up bestie: lookbehind assertions without a bounding length are not supported. like, at all. so don't come for this function with unbounded energy, it will not help you π
and the result? always zero. every single time. iconic behaviour honestly πβ¨
if you want the full lore, there's a complete description of the PCRE2 native API over in the pcre2api page, and a description of the POSIX API in the pcre2posix page. go read those too, you deserve it π
π¦ SEE ALSO π¦
pcre2apiβ the whole native API, full description πpcre2posixβ the POSIX API description π
and that's the page!! mwah π this was PCRE2 10.47, dated 11 August 2023, and the page you're on is PCRE2_SET_NEWLINE(3) β go forth and bound your lookbehinds responsibly bestie πβπ
π¦ 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