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

# pcre2\_set\_compile\_extra\_options(3)

Perl-compatible regular expressions (revised API)

## NAME

PCRE2 - Perl-compatible regular expressions (revised API)

## SYNOPSIS

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

```
int pcre2_set_compile_extra_options(pcre2_compile_context *ccontext,
  uint32_t extra_options);
```

## DESCRIPTION

This function sets additional option bits for **pcre2\_compile()** that are housed in a compile context. It completely replaces all the bits. The extra options are:

  PCRE2\_EXTRA\_ALLOW\_LOOKAROUND\_BSK     Allow \\K in lookarounds\
   PCRE2\_EXTRA\_ALLOW\_SURROGATE\_ESCAPES  Allow \\x{d800} to \\x{dfff}\
                                          in UTF-8 and UTF-32 modes\
   PCRE2\_EXTRA\_ALT\_BSUX                 Extended alternate \\u, \\U, and\
                                          \\x handling\
   PCRE2\_EXTRA\_ASCII\_BSD                \\d remains ASCII in UCP mode\
   PCRE2\_EXTRA\_ASCII\_BSS                \\s remains ASCII in UCP mode\
   PCRE2\_EXTRA\_ASCII\_BSW                \\w remains ASCII in UCP mode\
   PCRE2\_EXTRA\_ASCII\_DIGIT              \[:digit:\] and \[:xdigit:\] POSIX classes\
                                          remain ASCII in UCP mode\
   PCRE2\_EXTRA\_ASCII\_POSIX              POSIX classes remain ASCII in\
                                          UCP mode\
   PCRE2\_EXTRA\_BAD\_ESCAPE\_IS\_LITERAL    Treat all invalid escapes as\
                                          a literal following character\
   PCRE2\_EXTRA\_CASELESS\_RESTRICT        Disable mixed ASCII/non-ASCII\
                                          case folding\
   PCRE2\_EXTRA\_ESCAPED\_CR\_IS\_LF         Interpret \\r as \\n\
   PCRE2\_EXTRA\_MATCH\_LINE               Pattern matches whole lines\
   PCRE2\_EXTRA\_MATCH\_WORD               Pattern matches "words"\
   PCRE2\_EXTRA\_NEVER\_CALLOUT            Disallow callouts in pattern\
   PCRE2\_EXTRA\_NO\_BS0                   Disallow \\0 (but not \\00 or \\000)\
   PCRE2\_EXTRA\_PYTHON\_OCTAL             Use Python rules for octal\
   PCRE2\_EXTRA\_TURKISH\_CASING           Use Turkish I case folding

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.
