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
18
19 This function compiles a regular expression into an internal form. It
20 is the same as pcre_compile(), except for the addition of the errorā
21 codeptr argument. The arguments are:
22
23
24 pattern A zero-terminated string containing the
25 regular expression to be compiled
26 options Zero or more option bits
27 errorcodeptr Where to put an error code
28 errptr Where to put an error message
29 erroffset Offset in pattern where error was found
30 tableptr Pointer to character tables, or NULL to
31 use the built-in default
32
33 The option bits are:
34
35 PCRE_ANCHORED Force pattern anchoring
36 PCRE_AUTO_CALLOUT Compile automatic callouts
37 PCRE_CASELESS Do caseless matching
38 PCRE_DOLLAR_ENDONLY $ not to match newline at end
39 PCRE_DOTALL . matches anything including NL
40 PCRE_DUPNAMES Allow duplicate names for subpatterns
41 PCRE_EXTENDED Ignore whitespace and # comments
42 PCRE_EXTRA PCRE extra features
43 (not much use currently)
44 PCRE_FIRSTLINE Force matching to be before newline
45 PCRE_MULTILINE ^ and $ match newlines within data
46 PCRE_NEWLINE_ANY Recognize any Unicode newline sequence
47 PCRE_NEWLINE_ANYCRLF Recognize CR, LF, and CRLF as newline sequences
48 PCRE_NEWLINE_CR Set CR as the newline sequence
49 PCRE_NEWLINE_CRLF Set CRLF as the newline sequence
50 PCRE_NEWLINE_LF Set LF as the newline sequence
51 PCRE_NO_AUTO_CAPTURE Disable numbered capturing paren-
52 theses (named ones available)
53 PCRE_UNGREEDY Invert greediness of quantifiers
54 PCRE_UTF8 Run in UTF-8 mode
55 PCRE_NO_UTF8_CHECK Do not check the pattern for UTF-8
56 validity (only relevant if
57 PCRE_UTF8 is set)
58
59 PCRE must be built with UTF-8 support in order to use PCRE_UTF8 and
60 PCRE_NO_UTF8_CHECK.
61
62 The yield of the function is a pointer to a private data structure that
63 contains the compiled pattern, or NULL if an error was detected. Note
64 that compiling regular expressions with one version of PCRE for use
65 with a different version is not guaranteed to work and may cause
66 crashes.
67
68 There is a complete description of the PCRE native API in the pcreapi
69 page and a description of the POSIX API in the pcreposix page.
70
71
72
73 PCRE_COMPILE2(3)