chiark / gitweb /
Apply upstream revision 1631 (Closes: #815921)
[pcre3.git] / doc / pcrelimits.3
1 .TH PCRELIMITS 3 "05 November 2013" "PCRE 8.34"
2 .SH NAME
3 PCRE - Perl-compatible regular expressions
4 .SH "SIZE AND OTHER LIMITATIONS"
5 .rs
6 .sp
7 There are some size limitations in PCRE but it is hoped that they will never in
8 practice be relevant.
9 .P
10 The maximum length of a compiled pattern is approximately 64K data units (bytes
11 for the 8-bit library, 16-bit units for the 16-bit library, and 32-bit units for
12 the 32-bit library) if PCRE is compiled with the default internal linkage size,
13 which is 2 bytes for the 8-bit and 16-bit libraries, and 4 bytes for the 32-bit
14 library. If you want to process regular expressions that are truly enormous,
15 you can compile PCRE with an internal linkage size of 3 or 4 (when building the
16 16-bit or 32-bit library, 3 is rounded up to 4). See the \fBREADME\fP file in
17 the source distribution and the
18 .\" HREF
19 \fBpcrebuild\fP
20 .\"
21 documentation for details. In these cases the limit is substantially larger.
22 However, the speed of execution is slower.
23 .P
24 All values in repeating quantifiers must be less than 65536.
25 .P
26 There is no limit to the number of parenthesized subpatterns, but there can be
27 no more than 65535 capturing subpatterns. There is, however, a limit to the
28 depth of nesting of parenthesized subpatterns of all kinds. This is imposed in
29 order to limit the amount of system stack used at compile time. The limit can
30 be specified when PCRE is built; the default is 250.
31 .P
32 There is a limit to the number of forward references to subsequent subpatterns
33 of around 200,000. Repeated forward references with fixed upper limits, for
34 example, (?2){0,100} when subpattern number 2 is to the right, are included in
35 the count. There is no limit to the number of backward references.
36 .P
37 The maximum length of name for a named subpattern is 32 characters, and the
38 maximum number of named subpatterns is 10000.
39 .P
40 The maximum length of a name in a (*MARK), (*PRUNE), (*SKIP), or (*THEN) verb
41 is 255 for the 8-bit library and 65535 for the 16-bit and 32-bit libraries.
42 .P
43 The maximum length of a subject string is the largest positive number that an
44 integer variable can hold. However, when using the traditional matching
45 function, PCRE uses recursion to handle subpatterns and indefinite repetition.
46 This means that the available stack space may limit the size of a subject
47 string that can be processed by certain patterns. For a discussion of stack
48 issues, see the
49 .\" HREF
50 \fBpcrestack\fP
51 .\"
52 documentation.
53 .
54 .
55 .SH AUTHOR
56 .rs
57 .sp
58 .nf
59 Philip Hazel
60 University Computing Service
61 Cambridge CB2 3QH, England.
62 .fi
63 .
64 .
65 .SH REVISION
66 .rs
67 .sp
68 .nf
69 Last updated: 05 November 2013
70 Copyright (c) 1997-2013 University of Cambridge.
71 .fi