| 49 |
Behave as if each regex has the \fB/I\fP modifier; information about the |
Behave as if each regex has the \fB/I\fP modifier; information about the |
| 50 |
compiled pattern is given after compilation. |
compiled pattern is given after compilation. |
| 51 |
.TP 10 |
.TP 10 |
| 52 |
|
\fB-M\fP |
| 53 |
|
Behave as if each data line contains the \eM escape sequence; this causes |
| 54 |
|
PCRE to discover the minimum MATCH_LIMIT and MATCH_LIMIT_RECURSION settings by |
| 55 |
|
calling \fBpcre_exec()\fP repeatedly with different limits. |
| 56 |
|
.TP 10 |
| 57 |
\fB-m\fP |
\fB-m\fP |
| 58 |
Output the size of each compiled pattern after it has been compiled. This is |
Output the size of each compiled pattern after it has been compiled. This is |
| 59 |
equivalent to adding \fB/M\fP to each regular expression. For compatibility |
equivalent to adding \fB/M\fP to each regular expression. For compatibility |
| 102 |
stdout, and prompts for each line of input, using "re>" to prompt for regular |
stdout, and prompts for each line of input, using "re>" to prompt for regular |
| 103 |
expressions, and "data>" to prompt for data lines. |
expressions, and "data>" to prompt for data lines. |
| 104 |
.P |
.P |
| 105 |
|
When \fBpcretest\fP is built, a configuration option can specify that it should |
| 106 |
|
be linked with the \fBlibreadline\fP library. When this is done, if the input |
| 107 |
|
is from a terminal, it is read using the \fBreadline()\fP function. This |
| 108 |
|
provides line-editing and history facilities. The output from the \fB-help\fP |
| 109 |
|
option states whether or not \fBreadline()\fP will be used. |
| 110 |
|
.P |
| 111 |
The program handles any number of sets of input on a single input file. Each |
The program handles any number of sets of input on a single input file. Each |
| 112 |
set starts with a regular expression, and continues with any number of data |
set starts with a regular expression, and continues with any number of data |
| 113 |
lines to be matched against the pattern. |
lines to be matched against the pattern. |
| 176 |
\fB/N\fP PCRE_NO_AUTO_CAPTURE |
\fB/N\fP PCRE_NO_AUTO_CAPTURE |
| 177 |
\fB/U\fP PCRE_UNGREEDY |
\fB/U\fP PCRE_UNGREEDY |
| 178 |
\fB/X\fP PCRE_EXTRA |
\fB/X\fP PCRE_EXTRA |
| 179 |
|
\fB/<JS>\fP PCRE_JAVASCRIPT_COMPAT |
| 180 |
\fB/<cr>\fP PCRE_NEWLINE_CR |
\fB/<cr>\fP PCRE_NEWLINE_CR |
| 181 |
\fB/<lf>\fP PCRE_NEWLINE_LF |
\fB/<lf>\fP PCRE_NEWLINE_LF |
| 182 |
\fB/<crlf>\fP PCRE_NEWLINE_CRLF |
\fB/<crlf>\fP PCRE_NEWLINE_CRLF |
| 460 |
.P |
.P |
| 461 |
When a match succeeds, pcretest outputs the list of captured substrings that |
When a match succeeds, pcretest outputs the list of captured substrings that |
| 462 |
\fBpcre_exec()\fP returns, starting with number 0 for the string that matched |
\fBpcre_exec()\fP returns, starting with number 0 for the string that matched |
| 463 |
the whole pattern. Otherwise, it outputs "No match" or "Partial match" |
the whole pattern. Otherwise, it outputs "No match" or "Partial match" followed |
| 464 |
when \fBpcre_exec()\fP returns PCRE_ERROR_NOMATCH or PCRE_ERROR_PARTIAL, |
by the partially matching substring when \fBpcre_exec()\fP returns |
| 465 |
respectively, and otherwise the PCRE negative error number. Here is an example |
PCRE_ERROR_NOMATCH or PCRE_ERROR_PARTIAL, respectively, and otherwise the PCRE |
| 466 |
of an interactive \fBpcretest\fP run. |
negative error number. Here is an example of an interactive \fBpcretest\fP run. |
| 467 |
.sp |
.sp |
| 468 |
$ pcretest |
$ pcretest |
| 469 |
PCRE version 7.0 30-Nov-2006 |
PCRE version 7.0 30-Nov-2006 |
| 475 |
data> xyz |
data> xyz |
| 476 |
No match |
No match |
| 477 |
.sp |
.sp |
| 478 |
Note that unset capturing substrings that are not followed by one that is set |
Note that unset capturing substrings that are not followed by one that is set |
| 479 |
are not returned by \fBpcre_exec()\fP, and are not shown by \fBpcretest\fP. In |
are not returned by \fBpcre_exec()\fP, and are not shown by \fBpcretest\fP. In |
| 480 |
the following example, there are two capturing substrings, but when the first |
the following example, there are two capturing substrings, but when the first |
| 481 |
data line is matched, the second, unset substring is not shown. An "internal" |
data line is matched, the second, unset substring is not shown. An "internal" |
| 482 |
unset substring is shown as "<unset>", as for the second data line. |
unset substring is shown as "<unset>", as for the second data line. |
| 483 |
.sp |
.sp |
| 484 |
re> /(a)|(b)/ |
re> /(a)|(b)/ |
| 488 |
data> b |
data> b |
| 489 |
0: b |
0: b |
| 490 |
1: <unset> |
1: <unset> |
| 491 |
2: b |
2: b |
| 492 |
.sp |
.sp |
| 493 |
If the strings contain any non-printing characters, they are output as \e0x |
If the strings contain any non-printing characters, they are output as \e0x |
| 494 |
escapes, or as \ex{...} escapes if the \fB/8\fP modifier was present on the |
escapes, or as \ex{...} escapes if the \fB/8\fP modifier was present on the |
| 723 |
.rs |
.rs |
| 724 |
.sp |
.sp |
| 725 |
.nf |
.nf |
| 726 |
Last updated: 19 November 2007 |
Last updated: 25 August 2009 |
| 727 |
Copyright (c) 1997-2007 University of Cambridge. |
Copyright (c) 1997-2009 University of Cambridge. |
| 728 |
.fi |
.fi |