1 .TH PCRE_COMPILE2 3 "24 June 2012" "PCRE 8.30"
3 PCRE - Perl-compatible regular expressions
10 .B pcre *pcre_compile2(const char *\fIpattern\fP, int \fIoptions\fP,
12 .B int *\fIerrorcodeptr\fP,
14 .B const char **\fIerrptr\fP, int *\fIerroffset\fP,
16 .B const unsigned char *\fItableptr\fP);
18 .B pcre16 *pcre16_compile2(PCRE_SPTR16 \fIpattern\fP, int \fIoptions\fP,
20 .B int *\fIerrorcodeptr\fP,
22 .B const char **\fIerrptr\fP, int *\fIerroffset\fP,
24 .B const unsigned char *\fItableptr\fP);
26 .B pcre32 *pcre32_compile2(PCRE_SPTR32 \fIpattern\fP, int \fIoptions\fP,
28 .B int *\fIerrorcodeptr\fP,
30 .B const char **\fIerrptr\fP, int *\fIerroffset\fP,
32 .B const unsigned char *\fItableptr\fP);
37 This function compiles a regular expression into an internal form. It is the
38 same as \fBpcre[16|32]_compile()\fP, except for the addition of the
39 \fIerrorcodeptr\fP argument. The arguments are:
42 \fIpattern\fP A zero-terminated string containing the
43 regular expression to be compiled
44 \fIoptions\fP Zero or more option bits
45 \fIerrorcodeptr\fP Where to put an error code
46 \fIerrptr\fP Where to put an error message
47 \fIerroffset\fP Offset in pattern where error was found
48 \fItableptr\fP Pointer to character tables, or NULL to
49 use the built-in default
53 PCRE_ANCHORED Force pattern anchoring
54 PCRE_AUTO_CALLOUT Compile automatic callouts
55 PCRE_BSR_ANYCRLF \eR matches only CR, LF, or CRLF
56 PCRE_BSR_UNICODE \eR matches all Unicode line endings
57 PCRE_CASELESS Do caseless matching
58 PCRE_DOLLAR_ENDONLY $ not to match newline at end
59 PCRE_DOTALL . matches anything including NL
60 PCRE_DUPNAMES Allow duplicate names for subpatterns
61 PCRE_EXTENDED Ignore white space and # comments
62 PCRE_EXTRA PCRE extra features
63 (not much use currently)
64 PCRE_FIRSTLINE Force matching to be before newline
65 PCRE_JAVASCRIPT_COMPAT JavaScript compatibility
66 PCRE_MULTILINE ^ and $ match newlines within data
67 PCRE_NEWLINE_ANY Recognize any Unicode newline sequence
68 PCRE_NEWLINE_ANYCRLF Recognize CR, LF, and CRLF as newline
70 PCRE_NEWLINE_CR Set CR as the newline sequence
71 PCRE_NEWLINE_CRLF Set CRLF as the newline sequence
72 PCRE_NEWLINE_LF Set LF as the newline sequence
73 PCRE_NO_AUTO_CAPTURE Disable numbered capturing paren-
74 theses (named ones available)
75 PCRE_NO_UTF16_CHECK Do not check the pattern for UTF-16
76 validity (only relevant if
78 PCRE_NO_UTF32_CHECK Do not check the pattern for UTF-32
79 validity (only relevant if
81 PCRE_NO_UTF8_CHECK Do not check the pattern for UTF-8
82 validity (only relevant if
84 PCRE_UCP Use Unicode properties for \ed, \ew, etc.
85 PCRE_UNGREEDY Invert greediness of quantifiers
86 PCRE_UTF16 Run \fBpcre16_compile()\fP in UTF-16 mode
87 PCRE_UTF32 Run \fBpcre32_compile()\fP in UTF-32 mode
88 PCRE_UTF8 Run \fBpcre_compile()\fP in UTF-8 mode
90 PCRE must be built with UTF support in order to use PCRE_UTF8/16/32 and
91 PCRE_NO_UTF8/16/32_CHECK, and with UCP support if PCRE_UCP is used.
93 The yield of the function is a pointer to a private data structure that
94 contains the compiled pattern, or NULL if an error was detected. Note that
95 compiling regular expressions with one version of PCRE for use with a different
96 version is not guaranteed to work and may cause crashes.
98 There is a complete description of the PCRE native API in the
102 page and a description of the POSIX API in the