PCRE2\_SET\_COMPILE\_EXTRA\_OPTIONS(3) Library Functions Manual PCRE2\_SET\_COMPILE\_EXTRA\_OPTIONS(3)

# [NAME](#NAME)

PCRE2 - Perl-compatible regular expressions (revised API)

# [SYNOPSIS](#SYNOPSIS)

**#include &lt;pcre2.h&gt;**

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

# [DESCRIPTION](#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.

14 October 2024 PCRE2 10.49

---

Document: pcre2_set_compile_extra_options(3) from pcre2 10.49-r2 (Chainguard OS)
Source: https://github.com/PCRE2Project/pcre2.git
