1PCRE_COMPILE2(3) Library Functions Manual PCRE_COMPILE2(3)
2
3
4
6 PCRE - Perl-compatible regular expressions
7
9
10 #include <pcre.h>
11
12 pcre *pcre_compile2(const char *pattern, int options,
13 int *errorcodeptr,
14 const char **errptr, int *erroffset,
15 const unsigned char *tableptr);
16
17 pcre16 *pcre16_compile2(PCRE_SPTR16 pattern, int options,
18 int *errorcodeptr,
19 const char **errptr, int *erroffset,
20 const unsigned char *tableptr);
21
22 pcre32 *pcre32_compile2(PCRE_SPTR32 pattern, int options,
23 int *errorcodeptr,£
24 const char **errptr, int *erroffset,
25 const unsigned char *tableptr);
26
28
29 This function compiles a regular expression into an internal form. It
30 is the same as pcre[16|32]_compile(), except for the addition of the
31 errorcodeptr argument. The arguments are:
32
33 pattern A zero-terminated string containing the
34 regular expression to be compiled
35 options Zero or more option bits
36 errorcodeptr Where to put an error code
37 errptr Where to put an error message
38 erroffset Offset in pattern where error was found
39 tableptr Pointer to character tables, or NULL to
40 use the built-in default
41
42 The option bits are:
43
44 PCRE_ANCHORED Force pattern anchoring
45 PCRE_AUTO_CALLOUT Compile automatic callouts
46 PCRE_BSR_ANYCRLF \R matches only CR, LF, or CRLF
47 PCRE_BSR_UNICODE \R matches all Unicode line endings
48 PCRE_CASELESS Do caseless matching
49 PCRE_DOLLAR_ENDONLY $ not to match newline at end
50 PCRE_DOTALL . matches anything including NL
51 PCRE_DUPNAMES Allow duplicate names for subpatterns
52 PCRE_EXTENDED Ignore white space and # comments
53 PCRE_EXTRA PCRE extra features
54 (not much use currently)
55 PCRE_FIRSTLINE Force matching to be before newline
56 PCRE_JAVASCRIPT_COMPAT JavaScript compatibility
57 PCRE_MULTILINE ^ and $ match newlines within data
58 PCRE_NEVER_UTF Lock out UTF, e.g. via (*UTF)
59 PCRE_NEWLINE_ANY Recognize any Unicode newline sequence
60 PCRE_NEWLINE_ANYCRLF Recognize CR, LF, and CRLF as newline
61 sequences
62 PCRE_NEWLINE_CR Set CR as the newline sequence
63 PCRE_NEWLINE_CRLF Set CRLF as the newline sequence
64 PCRE_NEWLINE_LF Set LF as the newline sequence
65 PCRE_NO_AUTO_CAPTURE Disable numbered capturing paren-
66 theses (named ones available)
67 PCRE_NO_AUTO_POSSESS Disable auto-possessification
68 PCRE_NO_START_OPTIMIZE Disable match-time start optimizations
69 PCRE_NO_UTF16_CHECK Do not check the pattern for UTF-16
70 validity (only relevant if
71 PCRE_UTF16 is set)
72 PCRE_NO_UTF32_CHECK Do not check the pattern for UTF-32
73 validity (only relevant if
74 PCRE_UTF32 is set)
75 PCRE_NO_UTF8_CHECK Do not check the pattern for UTF-8
76 validity (only relevant if
77 PCRE_UTF8 is set)
78 PCRE_UCP Use Unicode properties for \d, \w, etc.
79 PCRE_UNGREEDY Invert greediness of quantifiers
80 PCRE_UTF16 Run pcre16_compile() in UTF-16 mode
81 PCRE_UTF32 Run pcre32_compile() in UTF-32 mode
82 PCRE_UTF8 Run pcre_compile() in UTF-8 mode
83
84 PCRE must be built with UTF support in order to use PCRE_UTF8/16/32 and
85 PCRE_NO_UTF8/16/32_CHECK, and with UCP support if PCRE_UCP is used.
86
87 The yield of the function is a pointer to a private data structure that
88 contains the compiled pattern, or NULL if an error was detected. Note
89 that compiling regular expressions with one version of PCRE for use
90 with a different version is not guaranteed to work and may cause
91 crashes.
92
93 There is a complete description of the PCRE native API in the pcreapi
94 page and a description of the POSIX API in the pcreposix page.
95
96
97
98PCRE 8.34 01 October 2013 PCRE_COMPILE2(3)