ViewVC logotype

Contents of /code/trunk/doc/html/pcrebuild.html

Parent Directory Parent Directory | Revision Log Revision Log

Revision 261 - (show annotations)
Fri Sep 21 08:37:48 2007 UTC (14 years ago) by ph10
File MIME type: text/html
File size: 12556 byte(s)
Final doc updates and file tidies for 7.4.
1 <html>
2 <head>
3 <title>pcrebuild specification</title>
4 </head>
6 <h1>pcrebuild man page</h1>
7 <p>
9 </p>
10 <p>
13 man page, in case the conversion went wrong.
14 <br>
15 <ul>
21 <li><a name="TOC6" href="#SEC6">WHAT \R MATCHES</a>
23 <li><a name="TOC8" href="#SEC8">POSIX MALLOC USAGE</a>
24 <li><a name="TOC9" href="#SEC9">HANDLING VERY LARGE PATTERNS</a>
25 <li><a name="TOC10" href="#SEC10">AVOIDING EXCESSIVE STACK USAGE</a>
26 <li><a name="TOC11" href="#SEC11">LIMITING PCRE RESOURCE USAGE</a>
27 <li><a name="TOC12" href="#SEC12">CREATING CHARACTER TABLES AT BUILD TIME</a>
28 <li><a name="TOC13" href="#SEC13">USING EBCDIC CODE</a>
29 <li><a name="TOC14" href="#SEC14">SEE ALSO</a>
30 <li><a name="TOC15" href="#SEC15">AUTHOR</a>
31 <li><a name="TOC16" href="#SEC16">REVISION</a>
32 </ul>
34 <P>
35 This document describes the optional features of PCRE that can be selected when
36 the library is compiled. It assumes use of the <b>configure</b> script, where
37 the optional features are selected or deselected by providing options to
40 the GUI facility of <b>CMakeSetup</b> if you are using <b>CMake</b> instead of
41 <b>configure</b> to build PCRE.
42 </P>
43 <P>
45 ones such as the selection of the installation directory) can be obtained by
46 running
47 <pre>
48 ./configure --help
49 </pre>
50 The following sections include descriptions of options whose names begin with
54 exists as well, but as it specifies the default, it is not described.
55 </P>
57 <P>
60 for PCRE. You can disable this by adding
61 <pre>
62 --disable-cpp
63 </pre>
64 to the <b>configure</b> command.
65 </P>
67 <P>
68 To build PCRE with support for UTF-8 character strings, add
69 <pre>
70 --enable-utf8
71 </pre>
75 function.
76 </P>
78 <P>
79 UTF-8 support allows PCRE to process character values greater than 255 in the
80 strings that it handles. On its own, however, it does not provide any
81 facilities for accessing the properties of such characters. If you want to be
83 character properties, you must add
84 <pre>
85 --enable-unicode-properties
86 </pre>
88 not explicitly requested it.
89 </P>
90 <P>
91 Including Unicode property support adds around 30K of tables to the PCRE
93 supported. Details are given in the
95 documentation.
96 </P>
98 <P>
99 By default, PCRE interprets character 10 (linefeed, LF) as indicating the end
101 compile PCRE to use character 13 (carriage return, CR) instead, by adding
102 <pre>
103 --enable-newline-is-cr
104 </pre>
106 which explicitly specifies linefeed as the newline character.
107 <br>
108 <br>
109 Alternatively, you can specify that line endings are to be indicated by the two
110 character sequence CRLF. If you want this, add
111 <pre>
112 --enable-newline-is-crlf
113 </pre>
115 <pre>
116 --enable-newline-is-anycrlf
117 </pre>
119 indicating a line ending. Finally, a fifth option, specified by
120 <pre>
121 --enable-newline-is-any
122 </pre>
123 causes PCRE to recognize any Unicode newline sequence.
124 </P>
125 <P>
126 Whatever line ending convention is selected when PCRE is built can be
127 overridden when the library functions are called. At build time it is
128 conventional to use the standard for your operating system.
129 </P>
130 <br><a name="SEC6" href="#TOC1">WHAT \R MATCHES</a><br>
131 <P>
132 By default, the sequence \R in a pattern matches any Unicode newline sequence,
133 whatever has been selected as the line ending sequence. If you specify
134 <pre>
135 --enable-bsr-anycrlf
136 </pre>
138 selected when PCRE is built can be overridden when the library functions are
139 called.
140 </P>
141 <br><a name="SEC7" href="#TOC1">BUILDING SHARED AND STATIC LIBRARIES</a><br>
142 <P>
144 Unix libraries by default. You can suppress one of these by adding one of
145 <pre>
146 --disable-shared
147 --disable-static
148 </pre>
149 to the <b>configure</b> command, as required.
150 </P>
151 <br><a name="SEC8" href="#TOC1">POSIX MALLOC USAGE</a><br>
152 <P>
153 When PCRE is called through the POSIX interface (see the
155 documentation), additional working storage is required for holding the pointers
156 to capturing substrings, because PCRE requires three integers per substring,
157 whereas the POSIX interface provides only two. If the number of expected
158 substrings is small, the wrapper function uses space on the stack, because this
161 such as
162 <pre>
163 --with-posix-malloc-threshold=20
164 </pre>
165 to the <b>configure</b> command.
166 </P>
167 <br><a name="SEC9" href="#TOC1">HANDLING VERY LARGE PATTERNS</a><br>
168 <P>
169 Within a compiled pattern, offset values are used to point from one part to
170 another (for example, from an opening parenthesis to an alternation
172 to a maximum size for a compiled pattern of around 64K. This is sufficient to
173 handle all but the most gigantic patterns. Nevertheless, some people do want to
174 process enormous patterns, so it is possible to compile PCRE to use three-byte
175 or four-byte offsets by adding a setting such as
176 <pre>
177 --with-link-size=3
178 </pre>
180 longer offsets slows down the operation of PCRE because it has to load
181 additional bytes when handling them.
182 </P>
183 <br><a name="SEC10" href="#TOC1">AVOIDING EXCESSIVE STACK USAGE</a><br>
184 <P>
187 environments where the size of the stack is limited, this can severely limit
188 PCRE's operation. (The Unix environment does not usually suffer from this
189 problem, but it may sometimes be necessary to increase the maximum stack size.
190 There is a discussion in the
192 documentation.) An alternative approach to recursion that uses memory from the
193 heap to remember data, instead of using recursive function calls, has been
194 implemented to work round the problem of limited stack size. If you want to
195 build a version of PCRE that works this way, add
196 <pre>
197 --disable-stack-for-recursion
198 </pre>
203 used.
204 </P>
205 <P>
206 Separate functions are provided rather than using <b>pcre_malloc</b> and
208 requested are always the same, and the blocks are always freed in reverse
209 order. A calling program might be able to implement optimized functions that
212 function; it is not relevant for the the <b>pcre_dfa_exec()</b> function.
213 </P>
214 <br><a name="SEC11" href="#TOC1">LIMITING PCRE RESOURCE USAGE</a><br>
215 <P>
218 function. By controlling the maximum number of times this function may be
219 called during a single matching operation, a limit can be placed on the
221 at run time, as described in the
223 documentation. The default is 10 million, but this can be changed by adding a
224 setting such as
225 <pre>
226 --with-match-limit=500000
227 </pre>
229 <b>pcre_dfa_exec()</b> matching function.
230 </P>
231 <P>
232 In some environments it is desirable to limit the depth of recursive calls of
237 constraints. However, you can set a lower limit by adding, for example,
238 <pre>
239 --with-match-limit-recursion=10000
240 </pre>
242 </P>
243 <br><a name="SEC12" href="#TOC1">CREATING CHARACTER TABLES AT BUILD TIME</a><br>
244 <P>
245 PCRE uses fixed tables for processing characters whose code values are less
248 only. If you add
249 <pre>
250 --enable-rebuild-chartables
251 </pre>
254 source for new set of tables, created in the default locale of your C runtime
255 system. (This method of replacing the tables does not work if you are cross
257 create alternative tables when cross compiling, you will have to do so "by
258 hand".)
259 </P>
260 <br><a name="SEC13" href="#TOC1">USING EBCDIC CODE</a><br>
261 <P>
262 PCRE assumes by default that it will run in an environment where the character
264 most computer operating systems. PCRE can, however, be compiled to run in an
265 EBCDIC environment by adding
266 <pre>
267 --enable-ebcdic
268 </pre>
269 to the <b>configure</b> command. This setting implies
271 an EBCDIC environment (for example, an IBM mainframe operating system).
272 </P>
273 <br><a name="SEC14" href="#TOC1">SEE ALSO</a><br>
274 <P>
276 </P>
277 <br><a name="SEC15" href="#TOC1">AUTHOR</a><br>
278 <P>
279 Philip Hazel
280 <br>
281 University Computing Service
282 <br>
283 Cambridge CB2 3QH, England.
284 <br>
285 </P>
286 <br><a name="SEC16" href="#TOC1">REVISION</a><br>
287 <P>
288 Last updated: 21 September 2007
289 <br>
290 Copyright &copy; 1997-2007 University of Cambridge.
291 <br>
292 <p>
294 </p>


Name Value
svn:eol-style native
svn:keywords "Author Date Id Revision Url"

  ViewVC Help
Powered by ViewVC 1.1.5