| 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 |
\fB--match-limit\fP=\fInumber\fP |
| 311 |
Processing some regular expression patterns can require a very large amount of |
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. |
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 |
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 |
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. |
the matching has two parameters that can limit the resources that it uses. |
| 316 |
.sp |
.sp |
| 317 |
The \fB--match-limit\fP option provides a means of limiting resource usage |
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 |
when processing patterns that are not going to match, but which have a very |
| 330 |
of calls, because not all calls to \fBmatch()\fP are recursive. This limit is |
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. |
of use only if it is set smaller than \fB--match-limit\fP. |
| 332 |
.sp |
.sp |
| 333 |
There are no short forms for these options. The default settings are specified |
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. |
when the PCRE library is compiled, with the default default being 10 million. |
| 335 |
.TP |
.TP |
| 336 |
\fB-M\fP, \fB--multiline\fP |
\fB-M\fP, \fB--multiline\fP |
| 383 |
exclusive with \fB--file-offsets\fP and \fB--line-offsets\fP. |
exclusive with \fB--file-offsets\fP and \fB--line-offsets\fP. |
| 384 |
.TP |
.TP |
| 385 |
\fB-o\fP\fInumber\fP, \fB--only-matching\fP=\fInumber\fP |
\fB-o\fP\fInumber\fP, \fB--only-matching\fP=\fInumber\fP |
| 386 |
Show only the part of the line that matched the capturing parentheses of the |
Show only the part of the line that matched the capturing parentheses of the |
| 387 |
given number. Up to 32 capturing parentheses are supported. Because these |
given number. Up to 32 capturing parentheses are supported. Because these |
| 388 |
options can be given without an argument (see above), if an argument is |
options can be given without an argument (see above), if an argument is |
| 389 |
present, it must be given in the same shell item, for example, -o3 or |
present, it must be given in the same shell item, for example, -o3 or |
| 390 |
--only-matching=2. The comments given for the non-argument case above also |
--only-matching=2. The comments given for the non-argument case above also |
| 391 |
apply to this case. If the specified capturing parentheses do not exist in the |
apply to this case. If the specified capturing parentheses do not exist in the |
| 392 |
pattern, or were not set in the match, nothing is output unless the file name |
pattern, or were not set in the match, nothing is output unless the file name |
| 393 |
or line number are being printed. |
or line number are being printed. |
| 394 |
.TP |
.TP |
| 395 |
\fB-q\fP, \fB--quiet\fP |
\fB-q\fP, \fB--quiet\fP |
| 484 |
-f/some/file |
-f/some/file |
| 485 |
-f /some/file |
-f /some/file |
| 486 |
.sp |
.sp |
| 487 |
The exception is the \fB-o\fP option, which may appear with or without data. |
The exception is the \fB-o\fP option, which may appear with or without data. |
| 488 |
Because of this, if data is present, it must follow immediately in the same |
Because of this, if data is present, it must follow immediately in the same |
| 489 |
item, for example -o3. |
item, for example -o3. |
| 490 |
.P |
.P |
| 491 |
If a long form option is used, the data may appear in the same command line |
If a long form option is used, the data may appear in the same command line |
| 503 |
The exceptions to the above are the \fB--colour\fP (or \fB--color\fP) and |
The exceptions to the above are the \fB--colour\fP (or \fB--color\fP) and |
| 504 |
\fB--only-matching\fP options, for which the data is optional. If one of these |
\fB--only-matching\fP options, for which the data is optional. If one of these |
| 505 |
options does have data, it must be given in the first form, using an equals |
options does have data, it must be given in the first form, using an equals |
| 506 |
character. Otherwise \fBpcregrep\P will assume that it has no data. |
character. Otherwise \fBpcregrep\fP will assume that it has no data. |
| 507 |
. |
. |
| 508 |
. |
. |
| 509 |
.SH "MATCHING ERRORS" |
.SH "MATCHING ERRORS" |
| 519 |
.P |
.P |
| 520 |
The \fB--match-limit\fP option of \fBpcregrep\fP can be used to set the overall |
The \fB--match-limit\fP option of \fBpcregrep\fP can be used to set the overall |
| 521 |
resource limit; there is a second option called \fB--recursion-limit\fP that |
resource limit; there is a second option called \fB--recursion-limit\fP that |
| 522 |
sets a limit on the amount of memory (usually stack) that is used (see the |
sets a limit on the amount of memory (usually stack) that is used (see the |
| 523 |
discussion of these options above). |
discussion of these options above). |
| 524 |
. |
. |
| 525 |
. |
. |