3 <title>pcre_compile2 specification</title>
5 <body bgcolor="#FFFFFF" text="#00005A" link="#0066FF" alink="#3399FF" vlink="#2222BB">
6 <h1>pcre_compile2 man page</h1>
8 Return to the <a href="index.html">PCRE index page</a>.
11 This page is part of the PCRE HTML documentation. It was generated automatically
12 from the original man page. If there is any nonsense in it, please consult the
13 man page, in case the conversion went wrong.
19 <b>#include <pcre.h></b>
22 <b>pcre *pcre_compile2(const char *<i>pattern</i>, int <i>options</i>,</b>
23 <b> int *<i>errorcodeptr</i>,</b>
24 <b> const char **<i>errptr</i>, int *<i>erroffset</i>,</b>
25 <b> const unsigned char *<i>tableptr</i>);</b>
28 <b>pcre16 *pcre16_compile2(PCRE_SPTR16 <i>pattern</i>, int <i>options</i>,</b>
29 <b> int *<i>errorcodeptr</i>,</b>
30 <b> const char **<i>errptr</i>, int *<i>erroffset</i>,</b>
31 <b> const unsigned char *<i>tableptr</i>);</b>
34 <b>pcre32 *pcre32_compile2(PCRE_SPTR32 <i>pattern</i>, int <i>options</i>,</b>
35 <b>" int *<i>errorcodeptr</i>,£</b>
36 <b> const char **<i>errptr</i>, int *<i>erroffset</i>,</b>
37 <b> const unsigned char *<i>tableptr</i>);</b>
43 This function compiles a regular expression into an internal form. It is the
44 same as <b>pcre[16|32]_compile()</b>, except for the addition of the
45 <i>errorcodeptr</i> argument. The arguments are:
47 <i>pattern</i> A zero-terminated string containing the
48 regular expression to be compiled
49 <i>options</i> Zero or more option bits
50 <i>errorcodeptr</i> Where to put an error code
51 <i>errptr</i> Where to put an error message
52 <i>erroffset</i> Offset in pattern where error was found
53 <i>tableptr</i> Pointer to character tables, or NULL to
54 use the built-in default
58 PCRE_ANCHORED Force pattern anchoring
59 PCRE_AUTO_CALLOUT Compile automatic callouts
60 PCRE_BSR_ANYCRLF \R matches only CR, LF, or CRLF
61 PCRE_BSR_UNICODE \R matches all Unicode line endings
62 PCRE_CASELESS Do caseless matching
63 PCRE_DOLLAR_ENDONLY $ not to match newline at end
64 PCRE_DOTALL . matches anything including NL
65 PCRE_DUPNAMES Allow duplicate names for subpatterns
66 PCRE_EXTENDED Ignore white space and # comments
67 PCRE_EXTRA PCRE extra features
68 (not much use currently)
69 PCRE_FIRSTLINE Force matching to be before newline
70 PCRE_JAVASCRIPT_COMPAT JavaScript compatibility
71 PCRE_MULTILINE ^ and $ match newlines within data
72 PCRE_NEVER_UTF Lock out UTF, e.g. via (*UTF)
73 PCRE_NEWLINE_ANY Recognize any Unicode newline sequence
74 PCRE_NEWLINE_ANYCRLF Recognize CR, LF, and CRLF as newline
76 PCRE_NEWLINE_CR Set CR as the newline sequence
77 PCRE_NEWLINE_CRLF Set CRLF as the newline sequence
78 PCRE_NEWLINE_LF Set LF as the newline sequence
79 PCRE_NO_AUTO_CAPTURE Disable numbered capturing paren-
80 theses (named ones available)
81 PCRE_NO_AUTO_POSSESS Disable auto-possessification
82 PCRE_NO_START_OPTIMIZE Disable match-time start optimizations
83 PCRE_NO_UTF16_CHECK Do not check the pattern for UTF-16
84 validity (only relevant if
86 PCRE_NO_UTF32_CHECK Do not check the pattern for UTF-32
87 validity (only relevant if
89 PCRE_NO_UTF8_CHECK Do not check the pattern for UTF-8
90 validity (only relevant if
92 PCRE_UCP Use Unicode properties for \d, \w, etc.
93 PCRE_UNGREEDY Invert greediness of quantifiers
94 PCRE_UTF16 Run <b>pcre16_compile()</b> in UTF-16 mode
95 PCRE_UTF32 Run <b>pcre32_compile()</b> in UTF-32 mode
96 PCRE_UTF8 Run <b>pcre_compile()</b> in UTF-8 mode
98 PCRE must be built with UTF support in order to use PCRE_UTF8/16/32 and
99 PCRE_NO_UTF8/16/32_CHECK, and with UCP support if PCRE_UCP is used.
102 The yield of the function is a pointer to a private data structure that
103 contains the compiled pattern, or NULL if an error was detected. Note that
104 compiling regular expressions with one version of PCRE for use with a different
105 version is not guaranteed to work and may cause crashes.
108 There is a complete description of the PCRE native API in the
109 <a href="pcreapi.html"><b>pcreapi</b></a>
110 page and a description of the POSIX API in the
111 <a href="pcreposix.html"><b>pcreposix</b></a>
114 Return to the <a href="index.html">PCRE index page</a>.