PCRE_CONFIG(3)
π PCRE_CONFIG(3) β girl, let's talk about your regex library β¨
okay so bestie, this one's from the Library Functions Manual π (that's the manual name, we're keeping it, it's part of the lore). It's all about PCRE β Perl-compatible regular expressions, no cap π¦
πΈ NAME πΈ
PCRE β Perl-compatible regular expressions π
β¨ SYNOPSIS β¨
#include <pcre.h>
int pcre_config(int what, void *where);
int pcre16_config(int what, void *where);
int pcre32_config(int what, void *where);
like, three whole flavors of the same vibe π«Ά
π DESCRIPTION π
So this function? It's literally your little spy π΅οΈβοΈβ¨ It lets a client program find out which optional features are available in the version of the PCRE library it's using. Iconic behaviour, honestly.
The arguments are giving:
whatβ a code specifying what information is required πwhereβ points to where to put the data π
β οΈ okay so pay attention here bestie: thewhereargument must point to an integer variable β EXCEPT forPCRE_CONFIG_MATCH_LIMIT,PCRE_CONFIG_MATCH_LIMIT_RECURSION, andPCRE_CONFIG_PARENS_LIMIT, where it must point to an unsigned long integer, and forPCRE_CONFIG_JITTARGET, where it must point to aconst char*. Don't get this wrong or it's giving chaos π
The available codes are:
PCRE_CONFIG_JITβ availability of just-in-time compiler support (1=yes0=no) π₯PCRE_CONFIG_JITTARGETβ string containing information about the target architecture for the JIT compiler, orNULLif there is no JIT supportPCRE_CONFIG_LINK_SIZEβ internal link size:2,3, or4PCRE_CONFIG_PARENS_LIMITβ parentheses nesting limitPCRE_CONFIG_MATCH_LIMITβ internal resource limitPCRE_CONFIG_MATCH_LIMIT_RECURSIONβ internal recursion depth limitPCRE_CONFIG_NEWLINEβ value of the default newline sequence:13(0x000d) for CR10(0x000a) for LF3338(0x0d0a) for CRLF-2for ANYCRLF-1for ANY
PCRE_CONFIG_BSRβ indicates what\Rmatches by default:0β all Unicode line endings1β CR, LF, or CRLF only
PCRE_CONFIG_POSIX_MALLOC_THRESHOLDβ threshold of return slots, above whichmalloc()is used by the POSIX APIPCRE_CONFIG_STACKRECURSEβ recursion implementation (1=stack0=heap)PCRE_CONFIG_UTF16β availability of UTF-16 support (1=yes0=no); option forpcre16_config()βPCRE_CONFIG_UTF32β availability of UTF-32 support (1=yes0=no); option forpcre32_config()βPCRE_CONFIG_UTF8β availability of UTF-8 support (1=yes0=no); option forpcre_config()βPCRE_CONFIG_UNICODE_PROPERTIESβ availability of Unicode property support (1=yes0=no) π
The function yields 0 on success or PCRE_ERROR_BADOPTION otherwise π€ That error is also given if:
PCRE_CONFIG_UTF16orPCRE_CONFIG_UTF32is passed topcre_config()PCRE_CONFIG_UTF8orPCRE_CONFIG_UTF32is passed topcre16_config()PCRE_CONFIG_UTF8orPCRE_CONFIG_UTF16is passed topcre32_config()
like, keep your functions and your options matched, bestie. it's giving compatibility. periodt π
There is a complete description of the PCRE native API in the pcreapi page π and a description of the POSIX API in the pcreposix page π β go read those if you want the full tea.
mwah π that's the whole page. this one's from PCRE 8.36, dated 20 April 2014 β vintage but still slaying, fr fr. go forth and pcre_config() responsibly, queen πβ¨
π¦ 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