PCRE2_SUBSTRING_LENGTH_BYNUMBER(3)
πΈ NAME
hiii bestie, welcome to the PCRE2_SUBSTRING_LENGTH_BYNUMBER(3) page, direct from the Library Functions Manual β yes, the title and manual-name situation are folded right in here so we can get to the good stuff β¨
PCRE2 β Perl-compatible regular expressions (revised API).
β¨ SYNOPSIS
okay so here's the exact summoning ritual:
#include <pcre2.h>
int pcre2_substring_length_bynumber(pcre2_match_data *match_data,
uint32_t number, PCRE2_SIZE *length);
π DESCRIPTION
This function is your go-to for finding the length of a matched substring, and you point at the substring by number. Here's what the arguments are doing:
match_dataβ the match data block for the match. literally the match's whole little data situation πnumberβ the substring number, aka which captured substring you're asking about.lengthβ where to return the length, orNULL.
You can pass NULL as that third argument if all you're trying to find out is whether or not a substring is set. Like, no cap, sometimes you just need the yes/no vibe.
On success the yield is 0; otherwise you get a negative error code. So 0 is the slay result, negative is the "something went sideways" result π
After a partial match, substring 0 is literally the only one available.
For the full breakdown of the PCRE2 native API, hit the pcre2api page; the POSIX API description lives in the pcre2posix page. Go off, bestie πβ¨
mwah π that's the whole page: PCRE2 10.47, dated 22 December 2014 β footer info but make it cute, 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