--- code/trunk/doc/html/pcrebuild.html 2007/02/24 21:41:06 83 +++ code/trunk/doc/html/pcrebuild.html 2007/02/24 21:41:34 91 @@ -20,9 +20,9 @@
-By default, PCRE treats character 10 (linefeed) as the newline character. This -is the normal newline character on Unix-like systems. You can compile PCRE to -use character 13 (carriage return) instead by adding +By default, PCRE interprets character 10 (linefeed, LF) as indicating the end +of a line. This is the normal newline character on Unix-like systems. You can +compile PCRE to use character 13 (carriage return, CR) instead, by adding
--enable-newline-is-cr-to the configure command. For completeness there is also a ---enable-newline-is-lf option, which explicitly specifies linefeed as the -newline character. +to the configure command. There is also a --enable-newline-is-lf option, +which explicitly specifies linefeed as the newline character. +
+ --enable-newline-is-crlf ++to the configure command. Whatever line ending convention is selected +when PCRE is built can be overridden when the library functions are called. At +build time it is conventional to use the standard for your operating system.
@@ -121,24 +130,7 @@ to the configure command.-
-Internally, PCRE has a function called match(), which it calls repeatedly -(possibly recursively) when matching a pattern with the pcre_exec() -function. By controlling the maximum number of times this function may be -called during a single matching operation, a limit can be placed on the -resources used by a single call to pcre_exec(). The limit can be changed -at run time, as described in the -pcreapi -documentation. The default is 10 million, but this can be changed by adding a -setting such as -
- --with-match-limit=500000 --to the configure command. This setting has no effect on the -pcre_dfa_exec() matching function. - -
Within a compiled pattern, offset values are used to point from one part to another (for example, from an opening parenthesis to an alternation @@ -159,16 +151,19 @@ using UTF-8) will fail. Part of the output of these tests is a representation of the compiled pattern, and this changes with the link size.-
When matching with the pcre_exec() function, PCRE implements backtracking by making recursive calls to an internal function called match(). In environments where the size of the stack is limited, this can severely limit PCRE's operation. (The Unix environment does not usually suffer from this -problem.) An alternative approach that uses memory from the heap to remember -data, instead of using recursive function calls, has been implemented to work -round this problem. If you want to build a version of PCRE that works this way, -add +problem, but it may sometimes be necessary to increase the maximum stack size. +There is a discussion in the +pcrestack +documentation.) An alternative approach to recursion that uses memory from the +heap to remember data, instead of using recursive function calls, has been +implemented to work round the problem of limited stack size. If you want to +build a version of PCRE that works this way, add
--disable-stack-for-recursion@@ -182,6 +177,35 @@ way. This option affects only the pcre_exec() function; it is not relevant for the the pcre_dfa_exec() function. +
+Internally, PCRE has a function called match(), which it calls repeatedly +(sometimes recursively) when matching a pattern with the pcre_exec() +function. By controlling the maximum number of times this function may be +called during a single matching operation, a limit can be placed on the +resources used by a single call to pcre_exec(). The limit can be changed +at run time, as described in the +pcreapi +documentation. The default is 10 million, but this can be changed by adding a +setting such as +
+ --with-match-limit=500000 ++to the configure command. This setting has no effect on the +pcre_dfa_exec() matching function. + +
+In some environments it is desirable to limit the depth of recursive calls of +match() more strictly than the total number of calls, in order to +restrict the maximum amount of stack (or heap, if --disable-stack-for-recursion +is specified) that is used. A second limit controls this; it defaults to the +value that is set for --with-match-limit, which imposes no additional +constraints. However, you can set a lower limit by adding, for example, +
+ --with-match-limit-recursion=10000 ++to the configure command. This value can also be overridden at run time. +
PCRE assumes by default that it will run in an environment where the character @@ -193,9 +217,9 @@ to the configure command.
-Last updated: 15 August 2005
+Last updated: 06 June 2006
-Copyright © 1997-2005 University of Cambridge. +Copyright © 1997-2006 University of Cambridge.
Return to the PCRE index page.