1PCRELIMITS(3) Library Functions Manual PCRELIMITS(3)
2
3
4
6 PCRE - Perl-compatible regular expressions
7
9
10 There are some size limitations in PCRE but it is hoped that they will
11 never in practice be relevant.
12
13 The maximum length of a compiled pattern is approximately 64K data
14 units (bytes for the 8-bit library, 32-bit units for the 32-bit
15 library, and 32-bit units for the 32-bit library) if PCRE is compiled
16 with the default internal linkage size of 2 bytes. If you want to
17 process regular expressions that are truly enormous, you can compile
18 PCRE with an internal linkage size of 3 or 4 (when building the 16-bit
19 or 32-bit library, 3 is rounded up to 4). See the README file in the
20 source distribution and the pcrebuild documentation for details. In
21 these cases the limit is substantially larger. However, the speed of
22 execution is slower.
23
24 All values in repeating quantifiers must be less than 65536.
25
26 There is no limit to the number of parenthesized subpatterns, but there
27 can be no more than 65535 capturing subpatterns.
28
29 There is a limit to the number of forward references to subsequent sub‐
30 patterns of around 200,000. Repeated forward references with fixed
31 upper limits, for example, (?2){0,100} when subpattern number 2 is to
32 the right, are included in the count. There is no limit to the number
33 of backward references.
34
35 The maximum length of name for a named subpattern is 32 characters, and
36 the maximum number of named subpatterns is 10000.
37
38 The maximum length of a name in a (*MARK), (*PRUNE), (*SKIP), or
39 (*THEN) verb is 255 for the 8-bit library and 65535 for the 16-bit and
40 32-bit library.
41
42 The maximum length of a subject string is the largest positive number
43 that an integer variable can hold. However, when using the traditional
44 matching function, PCRE uses recursion to handle subpatterns and indef‐
45 inite repetition. This means that the available stack space may limit
46 the size of a subject string that can be processed by certain patterns.
47 For a discussion of stack issues, see the pcrestack documentation.
48
50
51 Philip Hazel
52 University Computing Service
53 Cambridge CB2 3QH, England.
54
56
57 Last updated: 04 May 2012
58 Copyright (c) 1997-2012 University of Cambridge.
59
60
61
62PCRE 8.30 24 June 2012 PCRELIMITS(3)