---
name: "pcre2_config"
section: "3"
platform: "linux"
package: "pcre2"
version: "10.49-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/pcre2_config"
---

# pcre2\_config(3)

Perl-compatible regular expressions (revised API)

## NAME

PCRE2 - Perl-compatible regular expressions (revised API)

## SYNOPSIS

**#include \<pcre2.h\>**

```
int pcre2_config(uint32_t what, void *where);
```

## DESCRIPTION

This function makes it possible for a client program to find out which optional features are available in the version of the PCRE2 library it is using. The arguments are as follows:

  *what*     A code specifying what information is required\
   *where*    Points to where to put the information

If *where* is NULL, the function returns the amount of memory needed for the requested information. When the information is a string, the value is in code units; for other types of data it is in bytes.

If **where** is not NULL, for PCRE2\_CONFIG\_JITTARGET, PCRE2\_CONFIG\_UNICODE\_VERSION, and PCRE2\_CONFIG\_VERSION it must point to a buffer that is large enough to hold the string. For all other codes it must point to a uint32\_t integer variable. The available codes are:

  PCRE2\_CONFIG\_BSR                Indicates what \\R matches by default:\
                                     PCRE2\_BSR\_UNICODE\
                                     PCRE2\_BSR\_ANYCRLF\
   PCRE2\_CONFIG\_COMPILED\_WIDTHS    Which of 8/16/32 support was compiled\
   PCRE2\_CONFIG\_DEPTHLIMIT         Default backtracking depth limit\
   PCRE2\_CONFIG\_EFFECTIVE\_LINKSIZE How many bytes are used for link size\
   PCRE2\_CONFIG\_HEAPLIMIT          Default heap memory limit\
   PCRE2\_CONFIG\_JIT                Availability of just-in-time compiler\
                                    support (1=yes 0=no)\
   PCRE2\_CONFIG\_JITTARGET          Information (a string) about the target\
                                    architecture for the JIT compiler\
   PCRE2\_CONFIG\_LINKSIZE           Configured internal link size (2, 3, 4)\
   PCRE2\_CONFIG\_MATCHLIMIT         Default internal resource limit\
   PCRE2\_CONFIG\_NEVER\_BACKSLASH\_C  Whether or not \\C is disabled\
   PCRE2\_CONFIG\_NEWLINE            Code for the default newline sequence:\
                                     PCRE2\_NEWLINE\_CR\
                                     PCRE2\_NEWLINE\_LF\
                                     PCRE2\_NEWLINE\_CRLF\
                                     PCRE2\_NEWLINE\_ANY\
                                     PCRE2\_NEWLINE\_ANYCRLF\
                                     PCRE2\_NEWLINE\_NUL\
   PCRE2\_CONFIG\_PARENSLIMIT        Default parentheses nesting limit\
   PCRE2\_CONFIG\_RECURSIONLIMIT     Obsolete: use PCRE2\_CONFIG\_DEPTHLIMIT\
   PCRE2\_CONFIG\_STACKRECURSE       Obsolete: always returns 0\
   PCRE2\_CONFIG\_UNICODE            Availability of Unicode support\
                                    (1=yes 0=no)\
   PCRE2\_CONFIG\_UNICODE\_VERSION    The Unicode version (a string)\
   PCRE2\_CONFIG\_VERSION            The PCRE2 version (a string)

The function yields a non-negative value on success or the negative value PCRE2\_ERROR\_BADOPTION otherwise. This is also the result for the PCRE2\_CONFIG\_JITTARGET code if JIT support is not available. When a string is requested, the function returns the number of code units used, including the terminating zero.

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.
