| 25 |
slashes, as is common in Perl scripts), they are interpreted as part of the |
slashes, as is common in Perl scripts), they are interpreted as part of the |
| 26 |
pattern. Quotes can of course be used to delimit patterns on the command line |
pattern. Quotes can of course be used to delimit patterns on the command line |
| 27 |
because they are interpreted by the shell, and indeed they are required if a |
because they are interpreted by the shell, and indeed they are required if a |
| 28 |
pattern contains white space or shell metacharacters. |
pattern contains white space or shell metacharacters. |
| 29 |
.P |
.P |
| 30 |
The first argument that follows any option settings is treated as the single |
The first argument that follows any option settings is treated as the single |
| 31 |
pattern to be matched when neither \fB-e\fP nor \fB-f\fP is present. |
pattern to be matched when neither \fB-e\fP nor \fB-f\fP is present. |
| 50 |
BUFSIZ is defined in \fB<stdio.h>\fP. When there is more than one pattern |
BUFSIZ is defined in \fB<stdio.h>\fP. When there is more than one pattern |
| 51 |
(specified by the use of \fB-e\fP and/or \fB-f\fP), each pattern is applied to |
(specified by the use of \fB-e\fP and/or \fB-f\fP), each pattern is applied to |
| 52 |
each line in the order in which they are defined, except that all the \fB-e\fP |
each line in the order in which they are defined, except that all the \fB-e\fP |
| 53 |
patterns are tried before the \fB-f\fP patterns. |
patterns are tried before the \fB-f\fP patterns. |
| 54 |
.P |
.P |
| 55 |
By default, as soon as one pattern matches (or fails to match when \fB-v\fP is |
By default, as soon as one pattern matches (or fails to match when \fB-v\fP is |
| 56 |
used), no further patterns are considered. However, if \fB--colour\fP (or |
used), no further patterns are considered. However, if \fB--colour\fP (or |
| 62 |
all tried on the remainder of the line, but patterns that follow the one that |
all tried on the remainder of the line, but patterns that follow the one that |
| 63 |
matched are not tried on the earlier part of the line. |
matched are not tried on the earlier part of the line. |
| 64 |
.P |
.P |
| 65 |
This is the same behaviour as GNU grep, but it does mean that the order in |
This is the same behaviour as GNU grep, but it does mean that the order in |
| 66 |
which multiple patterns are specified can affect the output when one of the |
which multiple patterns are specified can affect the output when one of the |
| 67 |
above options is used. |
above options is used. |
| 68 |
.P |
.P |
| 69 |
Patterns that can match an empty string are accepted, but empty string |
Patterns that can match an empty string are accepted, but empty string |
| 70 |
matches are not recognized. An example is the pattern "(super)?(man)?", in |
matches are not recognized. An example is the pattern "(super)?(man)?", in |
| 71 |
which all components are optional. This pattern finds all occurrences of both |
which all components are optional. This pattern finds all occurrences of both |
| 72 |
"super" and "man"; the output differs from matching with "super|man" when only |
"super" and "man"; the output differs from matching with "super|man" when only |
| 73 |
the matching substrings are being shown. |
the matching substrings are being shown. |
| 130 |
a pattern should be coloured in the output. By default, the output is not |
a pattern should be coloured in the output. By default, the output is not |
| 131 |
coloured. The value (which is optional, see above) may be "never", "always", or |
coloured. The value (which is optional, see above) may be "never", "always", or |
| 132 |
"auto". In the latter case, colouring happens only if the standard output is |
"auto". In the latter case, colouring happens only if the standard output is |
| 133 |
connected to a terminal. More resources are used when colouring is enabled, |
connected to a terminal. More resources are used when colouring is enabled, |
| 134 |
because \fBpcregrep\fP has to search for all possible matches in a line, not |
because \fBpcregrep\fP has to search for all possible matches in a line, not |
| 135 |
just one, in order to colour them all. |
just one, in order to colour them all. |
| 136 |
|
|
| 137 |
The colour that is used can be specified by setting the environment variable |
The colour that is used can be specified by setting the environment variable |