new upstream release (3.3.0); modify package compatibility for Stretch
[ossec-hids.git] / src / external / pcre2-10.32 / doc / pcre2_pattern_info.3
1 .TH PCRE2_PATTERN_INFO 3 "16 December 2017" "PCRE2 10.31"
2 .SH NAME
3 PCRE2 - Perl-compatible regular expressions (revised API)
4 .SH SYNOPSIS
5 .rs
6 .sp
7 .B #include <pcre2.h>
8 .PP
9 .nf
10 .B int pcre2_pattern_info(const pcre2 *\fIcode\fP, uint32_t \fIwhat\fP, void *\fIwhere\fP);
11 .fi
12 .
13 .SH DESCRIPTION
14 .rs
15 .sp
16 This function returns information about a compiled pattern. Its arguments are:
17 .sp
18   \fIcode\fP     Pointer to a compiled regular expression pattern
19   \fIwhat\fP     What information is required
20   \fIwhere\fP    Where to put the information
21 .sp
22 The recognized values for the \fIwhat\fP argument, and the information they
23 request are as follows:
24 .sp
25   PCRE2_INFO_ALLOPTIONS      Final options after compiling
26   PCRE2_INFO_ARGOPTIONS      Options passed to \fBpcre2_compile()\fP
27   PCRE2_INFO_BACKREFMAX      Number of highest backreference
28   PCRE2_INFO_BSR             What \eR matches:
29                                PCRE2_BSR_UNICODE: Unicode line endings
30                                PCRE2_BSR_ANYCRLF: CR, LF, or CRLF only
31   PCRE2_INFO_CAPTURECOUNT    Number of capturing subpatterns
32 .\" JOIN
33   PCRE2_INFO_DEPTHLIMIT      Backtracking depth limit if set,
34                                otherwise PCRE2_ERROR_UNSET
35   PCRE2_INFO_EXTRAOPTIONS    Extra options that were passed in the
36                                compile context
37   PCRE2_INFO_FIRSTBITMAP     Bitmap of first code units, or NULL
38   PCRE2_INFO_FIRSTCODETYPE   Type of start-of-match information
39                                0 nothing set
40                                1 first code unit is set
41                                2 start of string or after newline
42   PCRE2_INFO_FIRSTCODEUNIT   First code unit when type is 1
43   PCRE2_INFO_FRAMESIZE       Size of backtracking frame
44   PCRE2_INFO_HASBACKSLASHC   Return 1 if pattern contains \eC
45 .\" JOIN
46   PCRE2_INFO_HASCRORLF       Return 1 if explicit CR or LF matches
47                                exist in the pattern
48 .\" JOIN
49   PCRE2_INFO_HEAPLIMIT       Heap memory limit if set,
50                                otherwise PCRE2_ERROR_UNSET
51   PCRE2_INFO_JCHANGED        Return 1 if (?J) or (?-J) was used
52   PCRE2_INFO_JITSIZE         Size of JIT compiled code, or 0
53   PCRE2_INFO_LASTCODETYPE    Type of must-be-present information
54                                0 nothing set
55                                1 code unit is set
56   PCRE2_INFO_LASTCODEUNIT    Last code unit when type is 1
57 .\" JOIN
58   PCRE2_INFO_MATCHEMPTY      1 if the pattern can match an
59                                empty string, 0 otherwise
60 .\" JOIN
61   PCRE2_INFO_MATCHLIMIT      Match limit if set,
62                                otherwise PCRE2_ERROR_UNSET
63 .\" JOIN
64   PCRE2_INFO_MAXLOOKBEHIND   Length (in characters) of the longest
65                                lookbehind assertion
66   PCRE2_INFO_MINLENGTH       Lower bound length of matching strings
67   PCRE2_INFO_NAMECOUNT       Number of named subpatterns
68   PCRE2_INFO_NAMEENTRYSIZE   Size of name table entries
69   PCRE2_INFO_NAMETABLE       Pointer to name table
70   PCRE2_CONFIG_NEWLINE       Code for the newline sequence:
71                                PCRE2_NEWLINE_CR
72                                PCRE2_NEWLINE_LF
73                                PCRE2_NEWLINE_CRLF
74                                PCRE2_NEWLINE_ANY
75                                PCRE2_NEWLINE_ANYCRLF
76                                PCRE2_NEWLINE_NUL
77   PCRE2_INFO_RECURSIONLIMIT  Obsolete synonym for PCRE2_INFO_DEPTHLIMIT
78   PCRE2_INFO_SIZE            Size of compiled pattern
79 .sp
80 If \fIwhere\fP is NULL, the function returns the amount of memory needed for
81 the requested information, in bytes. Otherwise, the \fIwhere\fP argument must
82 point to an unsigned 32-bit integer (uint32_t variable), except for the
83 following \fIwhat\fP values, when it must point to a variable of the type
84 shown:
85 .sp
86   PCRE2_INFO_FIRSTBITMAP     const uint8_t *
87   PCRE2_INFO_JITSIZE         size_t
88   PCRE2_INFO_NAMETABLE       PCRE2_SPTR
89   PCRE2_INFO_SIZE            size_t
90 .sp
91 The yield of the function is zero on success or:
92 .sp
93   PCRE2_ERROR_NULL           the argument \fIcode\fP is NULL
94   PCRE2_ERROR_BADMAGIC       the "magic number" was not found
95   PCRE2_ERROR_BADOPTION      the value of \fIwhat\fP is invalid
96   PCRE2_ERROR_BADMODE        the pattern was compiled in the wrong mode
97   PCRE2_ERROR_UNSET          the requested information is not set
98 .P
99 There is a complete description of the PCRE2 native API in the
100 .\" HREF
101 \fBpcre2api\fP
102 .\"
103 page and a description of the POSIX API in the
104 .\" HREF
105 \fBpcre2posix\fP
106 .\"
107 page.