1<html>
2<head>
3<title>pcre2_pattern_info specification</title>
4</head>
5<body bgcolor="#FFFFFF" text="#00005A" link="#0066FF" alink="#3399FF" vlink="#2222BB">
6<h1>pcre2_pattern_info man page</h1>
7<p>
8Return to the <a href="index.html">PCRE2 index page</a>.
9</p>
10<p>
11This page is part of the PCRE2 HTML documentation. It was generated
12automatically from the original man page. If there is any nonsense in it,
13please consult the man page, in case the conversion went wrong.
14<br>
15<br><b>
16SYNOPSIS
17</b><br>
18<P>
19<b>#include &#60;pcre2.h&#62;</b>
20</P>
21<P>
22<b>int pcre2_pattern_info(const pcre2_code *<i>code</i>, uint32_t <i>what</i>,</b>
23<b>   void *<i>where</i>);</b>
24</P>
25<br><b>
26DESCRIPTION
27</b><br>
28<P>
29This function returns information about a compiled pattern. Its arguments are:
30<pre>
31  <i>code</i>     Pointer to a compiled regular expression pattern
32  <i>what</i>     What information is required
33  <i>where</i>    Where to put the information
34</pre>
35The recognized values for the <i>what</i> argument, and the information they
36request are as follows:
37<pre>
38  PCRE2_INFO_ALLOPTIONS      Final options after compiling
39  PCRE2_INFO_ARGOPTIONS      Options passed to <b>pcre2_compile()</b>
40  PCRE2_INFO_BACKREFMAX      Number of highest backreference
41  PCRE2_INFO_BSR             What \R matches:
42                               PCRE2_BSR_UNICODE: Unicode line endings
43                               PCRE2_BSR_ANYCRLF: CR, LF, or CRLF only
44  PCRE2_INFO_CAPTURECOUNT    Number of capturing subpatterns
45  PCRE2_INFO_DEPTHLIMIT      Backtracking depth limit if set, otherwise PCRE2_ERROR_UNSET
46  PCRE2_INFO_EXTRAOPTIONS    Extra options that were passed in the
47                               compile context
48  PCRE2_INFO_FIRSTBITMAP     Bitmap of first code units, or NULL
49  PCRE2_INFO_FIRSTCODETYPE   Type of start-of-match information
50                               0 nothing set
51                               1 first code unit is set
52                               2 start of string or after newline
53  PCRE2_INFO_FIRSTCODEUNIT   First code unit when type is 1
54  PCRE2_INFO_FRAMESIZE       Size of backtracking frame
55  PCRE2_INFO_HASBACKSLASHC   Return 1 if pattern contains \C
56  PCRE2_INFO_HASCRORLF       Return 1 if explicit CR or LF matches exist in the pattern
57  PCRE2_INFO_HEAPLIMIT       Heap memory limit if set, otherwise PCRE2_ERROR_UNSET
58  PCRE2_INFO_JCHANGED        Return 1 if (?J) or (?-J) was used
59  PCRE2_INFO_JITSIZE         Size of JIT compiled code, or 0
60  PCRE2_INFO_LASTCODETYPE    Type of must-be-present information
61                               0 nothing set
62                               1 code unit is set
63  PCRE2_INFO_LASTCODEUNIT    Last code unit when type is 1
64  PCRE2_INFO_MATCHEMPTY      1 if the pattern can match an empty string, 0 otherwise
65  PCRE2_INFO_MATCHLIMIT      Match limit if set, otherwise PCRE2_ERROR_UNSET
66  PCRE2_INFO_MAXLOOKBEHIND   Length (in characters) of the longest lookbehind assertion
67  PCRE2_INFO_MINLENGTH       Lower bound length of matching strings
68  PCRE2_INFO_NAMECOUNT       Number of named subpatterns
69  PCRE2_INFO_NAMEENTRYSIZE   Size of name table entries
70  PCRE2_INFO_NAMETABLE       Pointer to name table
71  PCRE2_CONFIG_NEWLINE       Code for the newline sequence:
72                               PCRE2_NEWLINE_CR
73                               PCRE2_NEWLINE_LF
74                               PCRE2_NEWLINE_CRLF
75                               PCRE2_NEWLINE_ANY
76                               PCRE2_NEWLINE_ANYCRLF
77                               PCRE2_NEWLINE_NUL
78  PCRE2_INFO_RECURSIONLIMIT  Obsolete synonym for PCRE2_INFO_DEPTHLIMIT
79  PCRE2_INFO_SIZE            Size of compiled pattern
80</pre>
81If <i>where</i> is NULL, the function returns the amount of memory needed for
82the requested information, in bytes. Otherwise, the <i>where</i> argument must
83point to an unsigned 32-bit integer (uint32_t variable), except for the
84following <i>what</i> values, when it must point to a variable of the type
85shown:
86<pre>
87  PCRE2_INFO_FIRSTBITMAP     const uint8_t *
88  PCRE2_INFO_JITSIZE         size_t
89  PCRE2_INFO_NAMETABLE       PCRE2_SPTR
90  PCRE2_INFO_SIZE            size_t
91</pre>
92The yield of the function is zero on success or:
93<pre>
94  PCRE2_ERROR_NULL           the argument <i>code</i> is NULL
95  PCRE2_ERROR_BADMAGIC       the "magic number" was not found
96  PCRE2_ERROR_BADOPTION      the value of <i>what</i> is invalid
97  PCRE2_ERROR_BADMODE        the pattern was compiled in the wrong mode
98  PCRE2_ERROR_UNSET          the requested information is not set
99</PRE>
100</P>
101<P>
102There is a complete description of the PCRE2 native API in the
103<a href="pcre2api.html"><b>pcre2api</b></a>
104page and a description of the POSIX API in the
105<a href="pcre2posix.html"><b>pcre2posix</b></a>
106page.
107<p>
108Return to the <a href="index.html">PCRE2 index page</a>.
109</p>
110