PCRE2_SUBS...TABLE_SCAN(3)
okay bestie, welcome to the Library Functions Manual page for PCRE2_SUBS...TABLE_SCAN(3) π
this one is short but iconic.
π NAME π
PCRE2 - Perl-compatible regular expressions (revised API) β¨
β¨ SYNOPSIS β¨
this is the whole vibe, bestie:
#include <pcre2.h>
int pcre2_substring_nametable_scan(const pcre2_code *code,
PCRE2_SPTR name, PCRE2_SPTR *first, PCRE2_SPTR *last);
π¦ DESCRIPTION π¦
okay so this is a convenience function, and it does one very specific little job: for a compiled pattern, it finds the first and last entries for a given name in the table that translates capture group names into numbers. lowkey useful, no cap π
π the args π
codeβ Compiled regular expression πnameβ Name whose entries required πfirstβ Where to return a pointer to the first entry π«Άlastβ Where to return a pointer to the last entry π«Ά
πΈ what it returns, bestie πΈ
When the name is found in the table:
- if
firstisNULL, the function returns a group number π but if there is more than one matching entry, it is not defined which one π (so don't act brand new about it). - otherwise, when both pointers have been set, the yield of the function is the length of each entry in code units π.
If the name is not found, PCRE2_ERROR_NOSUBSTRING is returned π.
π where to learn more π
There is a complete description of the PCRE2 native API, including the format of the table entries, in the pcre2api page, and a description of the POSIX API in the pcre2posix page. go read those if you want the full lore πβ¨
mwah π this cutie is from PCRE2 10.47, dated 06 February 2019, and its whole title is PCRE2_SUBS...TABLE_SCAN(3) β Library Functions Manual bestie forever π«Άπ
π¦ 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