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