usbmodeswitch: Updated to v.1.2.6 from shibby's branch.
[tomato.git] / release / src / router / pcre / doc / pcre_compile2.3
blob1fcae433b43676921e58812f5a0a9029cfe23549
1 .TH PCRE_COMPILE2 3 "24 June 2012" "PCRE 8.30"
2 .SH NAME
3 PCRE - Perl-compatible regular expressions
4 .SH SYNOPSIS
5 .rs
6 .sp
7 .B #include <pcre.h>
8 .PP
9 .SM
10 .B pcre *pcre_compile2(const char *\fIpattern\fP, int \fIoptions\fP,
11 .ti +5n
12 .B int *\fIerrorcodeptr\fP,
13 .ti +5n
14 .B const char **\fIerrptr\fP, int *\fIerroffset\fP,
15 .ti +5n
16 .B const unsigned char *\fItableptr\fP);
17 .PP
18 .B pcre16 *pcre16_compile2(PCRE_SPTR16 \fIpattern\fP, int \fIoptions\fP,
19 .ti +5n
20 .B int *\fIerrorcodeptr\fP,
21 .ti +5n
22 .B const char **\fIerrptr\fP, int *\fIerroffset\fP,
23 .ti +5n
24 .B const unsigned char *\fItableptr\fP);
25 .PP
26 .B pcre32 *pcre32_compile2(PCRE_SPTR32 \fIpattern\fP, int \fIoptions\fP,
27 .ti +5n
28 .B int *\fIerrorcodeptr\fP,
29 .ti +5n
30 .B const char **\fIerrptr\fP, int *\fIerroffset\fP,
31 .ti +5n
32 .B const unsigned char *\fItableptr\fP);
34 .SH DESCRIPTION
35 .rs
36 .sp
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:
41 .sp
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
50 .sp
51 The option bits are:
52 .sp
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
69                             sequences
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
77                             PCRE_UTF16 is set)
78   PCRE_NO_UTF32_CHECK     Do not check the pattern for UTF-32
79                             validity (only relevant if
80                             PCRE_UTF32 is set)
81   PCRE_NO_UTF8_CHECK      Do not check the pattern for UTF-8
82                             validity (only relevant if
83                             PCRE_UTF8 is set)
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
89 .sp
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
99 .\" HREF
100 \fBpcreapi\fP
102 page and a description of the POSIX API in the
103 .\" HREF
104 \fBpcreposix\fP
106 page.