1PCRE_COMPILE(3)            Library Functions Manual            PCRE_COMPILE(3)
2
3
4

NAME

6       PCRE - Perl-compatible regular expressions
7

SYNOPSIS

9
10       #include <pcre.h>
11
12       pcre *pcre_compile(const char *pattern, int options,
13            const char **errptr, int *erroffset,
14            const unsigned char *tableptr);
15
16       pcre16 *pcre16_compile(PCRE_SPTR16 pattern, int options,
17            const char **errptr, int *erroffset,
18            const unsigned char *tableptr);
19
20       pcre32 *pcre32_compile(PCRE_SPTR32 pattern, int options,
21            const char **errptr, int *erroffset,
22            const unsigned char *tableptr);
23

DESCRIPTION

25
26       This  function  compiles a regular expression into an internal form. It
27       is the same as pcre[16|32]_compile2(), except for the  absence  of  the
28       errorcodeptr argument. Its arguments are:
29
30         pattern       A zero-terminated string containing the
31                         regular expression to be compiled
32         options       Zero or more option bits
33         errptr        Where to put an error message
34         erroffset     Offset in pattern where error was found
35         tableptr      Pointer to character tables, or NULL to
36                         use the built-in default
37
38       The option bits are:
39
40         PCRE_ANCHORED           Force pattern anchoring
41         PCRE_AUTO_CALLOUT       Compile automatic callouts
42         PCRE_BSR_ANYCRLF        \R matches only CR, LF, or CRLF
43         PCRE_BSR_UNICODE        \R matches all Unicode line endings
44         PCRE_CASELESS           Do caseless matching
45         PCRE_DOLLAR_ENDONLY     $ not to match newline at end
46         PCRE_DOTALL             . matches anything including NL
47         PCRE_DUPNAMES           Allow duplicate names for subpatterns
48         PCRE_EXTENDED           Ignore white space and # comments
49         PCRE_EXTRA              PCRE extra features
50                                   (not much use currently)
51         PCRE_FIRSTLINE          Force matching to be before newline
52         PCRE_JAVASCRIPT_COMPAT  JavaScript compatibility
53         PCRE_MULTILINE          ^ and $ match newlines within data
54         PCRE_NEWLINE_ANY        Recognize any Unicode newline sequence
55         PCRE_NEWLINE_ANYCRLF    Recognize CR, LF, and CRLF as newline
56                                   sequences
57         PCRE_NEWLINE_CR         Set CR as the newline sequence
58         PCRE_NEWLINE_CRLF       Set CRLF as the newline sequence
59         PCRE_NEWLINE_LF         Set LF as the newline sequence
60         PCRE_NO_AUTO_CAPTURE    Disable numbered capturing paren-
61                                   theses (named ones available)
62         PCRE_NO_UTF16_CHECK     Do not check the pattern for UTF-16
63                                   validity (only relevant if
64                                   PCRE_UTF16 is set)
65         PCRE_NO_UTF32_CHECK     Do not check the pattern for UTF-32
66                                   validity (only relevant if
67                                   PCRE_UTF32 is set)
68         PCRE_NO_UTF8_CHECK      Do not check the pattern for UTF-8
69                                   validity (only relevant if
70                                   PCRE_UTF8 is set)
71         PCRE_UCP                Use Unicode properties for \d, \w, etc.
72         PCRE_UNGREEDY           Invert greediness of quantifiers
73         PCRE_UTF16              Run in pcre16_compile() UTF-16 mode
74         PCRE_UTF32              Run in pcre32_compile() UTF-32 mode
75         PCRE_UTF8               Run in pcre_compile() UTF-8 mode
76
77       PCRE must be built with UTF support in order to use PCRE_UTF8/16/32 and
78       PCRE_NO_UTF8/16/32_CHECK, and with UCP support if PCRE_UCP is used.
79
80       The yield of the function is a pointer to a private data structure that
81       contains  the  compiled pattern, or NULL if an error was detected. Note
82       that compiling regular expressions with one version  of  PCRE  for  use
83       with  a  different  version  is  not  guaranteed  to work and may cause
84       crashes.
85
86       There is a complete description of the PCRE native API in  the  pcreapi
87       page and a description of the POSIX API in the pcreposix page.
88
89
90
91PCRE 8.30                        24 June 2012                  PCRE_COMPILE(3)
Impressum