new upstream release (3.3.0); modify package compatibility for Stretch
[ossec-hids.git] / src / external / pcre2-10.32 / doc / pcre2limits.3
1 .TH PCRE2LIMITS 3 "30 March 2017" "PCRE2 10.30"
2 .SH NAME
3 PCRE2 - Perl-compatible regular expressions (revised API)
4 .SH "SIZE AND OTHER LIMITATIONS"
5 .rs
6 .sp
7 There are some size limitations in PCRE2 but it is hoped that they will never
8 in practice be relevant.
9 .P
10 The maximum size of a compiled pattern is approximately 64 thousand code units
11 for the 8-bit and 16-bit libraries if PCRE2 is compiled with the default
12 internal linkage size, which is 2 bytes for these libraries. If you want to
13 process regular expressions that are truly enormous, you can compile PCRE2 with
14 an internal linkage size of 3 or 4 (when building the 16-bit library, 3 is
15 rounded up to 4). See the \fBREADME\fP file in the source distribution and the
16 .\" HREF
17 \fBpcre2build\fP
18 .\"
19 documentation for details. In these cases the limit is substantially larger.
20 However, the speed of execution is slower. In the 32-bit library, the internal
21 linkage size is always 4.
22 .P
23 The maximum length of a source pattern string is essentially unlimited; it is
24 the largest number a PCRE2_SIZE variable can hold. However, the program that
25 calls \fBpcre2_compile()\fP can specify a smaller limit.
26 .P
27 The maximum length (in code units) of a subject string is one less than the
28 largest number a PCRE2_SIZE variable can hold. PCRE2_SIZE is an unsigned
29 integer type, usually defined as size_t. Its maximum value (that is
30 ~(PCRE2_SIZE)0) is reserved as a special indicator for zero-terminated strings
31 and unset offsets.
32 .P
33 All values in repeating quantifiers must be less than 65536.
34 .P
35 The maximum length of a lookbehind assertion is 65535 characters.
36 .P
37 There is no limit to the number of parenthesized subpatterns, but there can be
38 no more than 65535 capturing subpatterns. There is, however, a limit to the
39 depth of nesting of parenthesized subpatterns of all kinds. This is imposed in
40 order to limit the amount of system stack used at compile time. The default
41 limit can be specified when PCRE2 is built; if not, the default is set to 250.
42 An application can change this limit by calling pcre2_set_parens_nest_limit()
43 to set the limit in a compile context.
44 .P
45 The maximum length of name for a named subpattern is 32 code units, and the
46 maximum number of named subpatterns is 10000.
47 .P
48 The maximum length of a name in a (*MARK), (*PRUNE), (*SKIP), or (*THEN) verb
49 is 255 code units for the 8-bit library and 65535 code units for the 16-bit and
50 32-bit libraries.
51 .P
52 The maximum length of a string argument to a callout is the largest number a
53 32-bit unsigned integer can hold.
54 .
55 .
56 .SH AUTHOR
57 .rs
58 .sp
59 .nf
60 Philip Hazel
61 University Computing Service
62 Cambridge, England.
63 .fi
64 .
65 .
66 .SH REVISION
67 .rs
68 .sp
69 .nf
70 Last updated: 30 March 2017
71 Copyright (c) 1997-2017 University of Cambridge.
72 .fi