/[pcre]/code/trunk/doc/pcregrep.1
ViewVC logotype

Diff of /code/trunk/doc/pcregrep.1

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 560 by ph10, Thu Jun 3 19:18:24 2010 UTC revision 561 by ph10, Sat Oct 30 18:37:47 2010 UTC
# Line 307  the value in the \fBLC_ALL\fP or \fBLC_C Line 307  the value in the \fBLC_ALL\fP or \fBLC_C
307  locale is specified, the PCRE library's default (usually the "C" locale) is  locale is specified, the PCRE library's default (usually the "C" locale) is
308  used. There is no short form for this option.  used. There is no short form for this option.
309  .TP  .TP
310    \fB--match-limit\fP=\fInumber\fP
311    Processing some regular expression patterns can require a very large amount of
312    memory, leading in some cases to a program crash if not enough is available.
313    Other patterns may take a very long time to search for all possible matching
314    strings. The \fBpcre_exec()\fP function that is called by \fBpcregrep\fP to do
315    the matching has two parameters that can limit the resources that it uses.
316    .sp
317    The \fB--match-limit\fP option provides a means of limiting resource usage
318    when processing patterns that are not going to match, but which have a very
319    large number of possibilities in their search trees. The classic example is a
320    pattern that uses nested unlimited repeats. Internally, PCRE uses a function
321    called \fBmatch()\fP which it calls repeatedly (sometimes recursively). The
322    limit set by \fb--match-limit\fP is imposed on the number of times this
323    function is called during a match, which has the effect of limiting the amount
324    of backtracking that can take place.
325    .sp
326    The \fB--recursion-limit\fP option is similar to \fB--match-limit\fP, but
327    instead of limiting the total number of times that \fBmatch()\fP is called, it
328    limits the depth of recursive calls, which in turn limits the amount of memory
329    that can be used. The recursion depth is a smaller number than the total number
330    of calls, because not all calls to \fBmatch()\fP are recursive. This limit is
331    of use only if it is set smaller than \fB--match-limit\fP.
332    .sp
333    There are no short forms for these options. The default settings are specified
334    when the PCRE library is compiled, with the default default being 10 million.
335    .TP
336  \fB-M\fP, \fB--multiline\fP  \fB-M\fP, \fB--multiline\fP
337  Allow patterns to match more than one line. When this option is given, patterns  Allow patterns to match more than one line. When this option is given, patterns
338  may usefully contain literal newline characters and internal occurrences of ^  may usefully contain literal newline characters and internal occurrences of ^
# Line 365  directory is read as a normal file; in s Line 391  directory is read as a normal file; in s
391  immediate end-of-file. This option is a shorthand for setting the \fB-d\fP  immediate end-of-file. This option is a shorthand for setting the \fB-d\fP
392  option to "recurse".  option to "recurse".
393  .TP  .TP
394    \fB--recursion-limit\fP=\fInumber\fP
395    See \fB--match-limit\fP above.
396    .TP
397  \fB-s\fP, \fB--no-messages\fP  \fB-s\fP, \fB--no-messages\fP
398  Suppress error messages about non-existent or unreadable files. Such files are  Suppress error messages about non-existent or unreadable files. Such files are
399  quietly skipped. However, the return code is still 2, even if matches were  quietly skipped. However, the return code is still 2, even if matches were
# Line 496  Cambridge CB2 3QH, England. Line 525  Cambridge CB2 3QH, England.
525  .rs  .rs
526  .sp  .sp
527  .nf  .nf
528  Last updated: 21 May 2010  Last updated: 30 October 2010
529  Copyright (c) 1997-2010 University of Cambridge.  Copyright (c) 1997-2010 University of Cambridge.
530  .fi  .fi

Legend:
Removed from v.560  
changed lines
  Added in v.561

  ViewVC Help
Powered by ViewVC 1.1.5