PCRE_GET_S...LE_ENTRIES(3)
πΈ PCRE_GET_S...LE_ENTRIES(3) πΈ
okay bestie, so this is a page from the Library Functions Manual for PCRE β that's Perl-compatible regular expressions β and we're about to get into the string-table lore. π
β¨ NAME β¨
PCRE β Perl-compatible regular expressions π¦
π SYNOPSIS π
#include <pcre.h>
int pcre_get_stringtable_entries(const pcre *code,
const char *name, char **first, char **last);
int pcre16_get_stringtable_entries(const pcre16 *code,
PCRE_SPTR16 name, PCRE_UCHAR16 **first, PCRE_UCHAR16 **last);
int pcre32_get_stringtable_entries(const pcre32 *code,
PCRE_SPTR32 name, PCRE_UCHAR32 **first, PCRE_UCHAR32 **last);
no cap, three flavors: 8-bit, 16-bit, 32-bit. pick your fighter. π
π DESCRIPTION π
so this convenience function is literally the friend that finds things for you. π«Ά for a compiled pattern, it finds the first and last entries for a given name in the table that translates capturing parenthesis names into numbers.
when names are required to be unique (akaPCRE_DUPNAMESis not set), it's usually easier to just usepcre[16|32]_get_stringnumber()instead. fr fr, save yourself the trouble. π
here's the lil parameter rundown, bestie:
codeβ the compiled regular expression πnameβ the name whose entries you're looking forfirstβ where to return a pointer to the first entrylastβ where to return a pointer to the last entry
the yield of the function (the thing it gives back) is the length of each entry, or PCRE_ERROR_NOSUBSTRING if none are found. π so if you get that error, it's giving "girl, there's nothing here."
and if you want the full tea: there's a complete description of the PCRE native API β including the format of the table entries β in the pcreapi page, plus a description of the POSIX API in the pcreposix page. go read those, iykyk. πβ¨
that's the whole vibe, bestie β go slay some regexes π
this was PCRE 8.30, dated 24 June 2012 πβ¨
π¦ where this page comes from
- alpine 3.22: pcre-doc 8.45-r4 Β· BSD-3-Clause
- alpine 3.23: pcre-doc 8.45-r4 Β· BSD-3-Clause
- alpine 3.24: pcre-doc 8.45-r4 Β· BSD-3-Clause
- arch rolling: pcre 8.45-5 Β· BSD
- centos-stream 9: pcre-devel 8.44-4.el9 Β· BSD
- centos-stream 9: pcre-devel 8.44-4.el9 Β· BSD
- debian bookworm: libpcre3-dev 2:8.39-15
- fedora 43: pcre-devel 8.45-1.fc43.9 Β· BSD-3-Clause
- fedora 43: pcre-devel 8.45-1.fc43.9 Β· BSD-3-Clause
- fedora 44: pcre-devel 8.45-1.fc43.9 Β· BSD-3-Clause
- fedora 44: pcre-devel 8.45-1.fc43.9 Β· BSD-3-Clause
- nixos 26.05: pcre 8.45
- nixos 26.05: pcre-cpp 8.45
- opensuse-leap 16.0: pcre-devel 8.45-160000.2.2 Β· BSD-3-Clause
- opensuse-leap 16.0: pcre-devel 8.45-160000.2.2 Β· BSD-3-Clause
- opensuse-leap 16.0: pcre-devel 8.45-160000.2.2 Β· BSD-3-Clause
- opensuse-leap 16.0: pcre-devel 8.45-160000.2.2 Β· BSD-3-Clause
- ubuntu jammy: libpcre3-dev 2:8.39-13build5
- ubuntu jammy: libpcre3-dev 2:8.39-13ubuntu0.22.04.1
- ubuntu noble: libpcre3-dev 2:8.39-15build1
- ubuntu questing: libpcre3-dev 2:8.39-15.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms