blob: 2cab81f087f514ed3844b769440aac8288dc3e0f [file] [log] [blame]
Tristan Matthews04616462013-11-14 16:09:34 -05001<html>
2<head>
3<title>pcrelimits specification</title>
4</head>
5<body bgcolor="#FFFFFF" text="#00005A" link="#0066FF" alink="#3399FF" vlink="#2222BB">
6<h1>pcrelimits man page</h1>
7<p>
8Return to the <a href="index.html">PCRE index page</a>.
9</p>
10<p>
11This page is part of the PCRE HTML documentation. It was generated automatically
12from the original man page. If there is any nonsense in it, please consult the
13man page, in case the conversion went wrong.
14<br>
15<br><b>
16SIZE AND OTHER LIMITATIONS
17</b><br>
18<P>
19There are some size limitations in PCRE but it is hoped that they will never in
20practice be relevant.
21</P>
22<P>
23The maximum length of a compiled pattern is 65539 (sic) bytes if PCRE is
24compiled with the default internal linkage size of 2. If you want to process
25regular expressions that are truly enormous, you can compile PCRE with an
26internal linkage size of 3 or 4 (see the <b>README</b> file in the source
27distribution and the
28<a href="pcrebuild.html"><b>pcrebuild</b></a>
29documentation for details). In these cases the limit is substantially larger.
30However, the speed of execution is slower.
31</P>
32<P>
33All values in repeating quantifiers must be less than 65536.
34</P>
35<P>
36There is no limit to the number of parenthesized subpatterns, but there can be
37no more than 65535 capturing subpatterns.
38</P>
39<P>
40There is a limit to the number of forward references to subsequent subpatterns
41of around 200,000. Repeated forward references with fixed upper limits, for
42example, (?2){0,100} when subpattern number 2 is to the right, are included in
43the count. There is no limit to the number of backward references.
44</P>
45<P>
46The maximum length of name for a named subpattern is 32 characters, and the
47maximum number of named subpatterns is 10000.
48</P>
49<P>
50The maximum length of a subject string is the largest positive number that an
51integer variable can hold. However, when using the traditional matching
52function, PCRE uses recursion to handle subpatterns and indefinite repetition.
53This means that the available stack space may limit the size of a subject
54string that can be processed by certain patterns. For a discussion of stack
55issues, see the
56<a href="pcrestack.html"><b>pcrestack</b></a>
57documentation.
58</P>
59<br><b>
60AUTHOR
61</b><br>
62<P>
63Philip Hazel
64<br>
65University Computing Service
66<br>
67Cambridge CB2 3QH, England.
68<br>
69</P>
70<br><b>
71REVISION
72</b><br>
73<P>
74Last updated: 30 November 2011
75<br>
76Copyright &copy; 1997-2011 University of Cambridge.
77<br>
78<p>
79Return to the <a href="index.html">PCRE index page</a>.
80</p>