PCRE2_GET_STARTCHAR(3)
π NAME π
hey bestie, welcome to the PCRE2_GET_STARTCHAR(3) page from the Library Functions Manual β it's all about PCRE2 β Perl-compatible regular expressions (revised API) πβ¨
πΈ SYNOPSIS πΈ
okay so here's the whole signature, no cap:
#include <pcre2.h>
PCRE2_SIZE pcre2_get_startchar(pcre2_match_data *match_data);
that's literally it. iconic. π
π¦ DESCRIPTION π¦
so picture this: you already called pcre2_match() and it succeeded, and you passed it the match block that is this function's argument. after that, pcre2_get_startchar() returns the code unit offset of the character at which the successful match started. slay. β¨
for a non-partial match, this can be different to the value of ovector[0] if the pattern contains the \K escape sequence. yes, \K is the little plot twist here ππ
but after a partial match? nope, no \K chaos: this value is always the same as ovector[0], because \K does not affect the result of a partial match. periodt. π«Ά
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, bestie ππ
no cap: the\Kdetail is the whole vibe check here β if the match is non-partial, start-char can disagree withovector[0]; if it's partial, they're matching. π₯
that's the whole page, bestie! brought to you by PCRE2 10.47, dated 25 October 2014, and the manual page name is PCRE2_GET_STARTCHAR(3) β byeeee π
ππ
π¦ 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