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

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

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

revision 611 by ph10, Mon Jun 6 17:46:22 2011 UTC revision 612 by ph10, Sat Jul 2 15:20:59 2011 UTC
# Line 4  pcretest - a program for testing Perl-co Line 4  pcretest - a program for testing Perl-co
4  .SH SYNOPSIS  .SH SYNOPSIS
5  .rs  .rs
6  .sp  .sp
7  .B pcretest "[options] [source] [destination]"  .B pcretest "[options] [input file [output file]]"
8  .sp  .sp
9  \fBpcretest\fP was written as a test program for the PCRE regular expression  \fBpcretest\fP was written as a test program for the PCRE regular expression
10  library itself, but it can also be used for experimenting with regular  library itself, but it can also be used for experimenting with regular
# Line 18  options, see the Line 18  options, see the
18  .\" HREF  .\" HREF
19  \fBpcreapi\fP  \fBpcreapi\fP
20  .\"  .\"
21  documentation.  documentation. The input for \fBpcretest\fP is a sequence of regular expression
22    patterns and strings to be matched, as described below. The output shows the
23    result of each match. Options on the command line and the patterns control PCRE
24    options and exactly what is output.
25  .  .
26  .  .
27  .SH OPTIONS  .SH COMMAND LINE OPTIONS
28  .rs  .rs
29  .TP 10  .TP 10
30  \fB-b\fP  \fB-b\fP
31  Behave as if each regex has the \fB/B\fP (show byte code) modifier; the  Behave as if each pattern has the \fB/B\fP (show byte code) modifier; the
32  internal form is output after compilation.  internal form is output after compilation.
33  .TP 10  .TP 10
34  \fB-C\fP  \fB-C\fP
# Line 33  Output the version number of the PCRE li Line 36  Output the version number of the PCRE li
36  about the optional features that are included, and then exit.  about the optional features that are included, and then exit.
37  .TP 10  .TP 10
38  \fB-d\fP  \fB-d\fP
39  Behave as if each regex has the \fB/D\fP (debug) modifier; the internal  Behave as if each pattern has the \fB/D\fP (debug) modifier; the internal
40  form and information about the compiled pattern is output after compilation;  form and information about the compiled pattern is output after compilation;
41  \fB-d\fP is equivalent to \fB-b -i\fP.  \fB-d\fP is equivalent to \fB-b -i\fP.
42  .TP 10  .TP 10
# Line 46  standard \fBpcre_exec()\fP function (mor Line 49  standard \fBpcre_exec()\fP function (mor
49  Output a brief summary these options and then exit.  Output a brief summary these options and then exit.
50  .TP 10  .TP 10
51  \fB-i\fP  \fB-i\fP
52  Behave as if each regex has the \fB/I\fP modifier; information about the  Behave as if each pattern has the \fB/I\fP modifier; information about the
53  compiled pattern is given after compilation.  compiled pattern is given after compilation.
54  .TP 10  .TP 10
55  \fB-M\fP  \fB-M\fP
# Line 67  changed for individual matching calls by Line 70  changed for individual matching calls by
70  below).  below).
71  .TP 10  .TP 10
72  \fB-p\fP  \fB-p\fP
73  Behave as if each regex has the \fB/P\fP modifier; the POSIX wrapper API is  Behave as if each pattern has the \fB/P\fP modifier; the POSIX wrapper API is
74  used to call PCRE. None of the other options has any effect when \fB-p\fP is  used to call PCRE. None of the other options has any effect when \fB-p\fP is
75  set.  set.
76  .TP 10  .TP 10
# Line 79  On Unix-like systems, set the size of th Line 82  On Unix-like systems, set the size of th
82  megabytes.  megabytes.
83  .TP 10  .TP 10
84  \fB-s\fP  \fB-s\fP
85  Behave as if each regex has the \fB/S\fP modifier; in other words, force each  Behave as if each pattern has the \fB/S\fP modifier; in other words, force each
86  regex to be studied.  pattern to be studied. If the \fB/I\fP or \fB/D\fP option is present on a
87    pattern (requesting output about the compiled pattern), information about the
88    result of studying is not included when studying is caused only by \fB-s\fP and
89    neither \fB-i\fP nor \fB-d\fP is present on the command line. This behaviour
90    means that the output from tests that are run with and without \fB-s\fP should
91    be identical, except when options that output information about the actual
92    running of a match are set. The \fB-M\fP, \fB-t\fP, and \fB-tm\fP options,
93    which give information about resources used, are likely to produce different
94    output with and without \fB-s\fP. Output may also differ if the \fB/C\fP option
95    is present on an individual pattern. This uses callouts to trace the the
96    matching process, and this may be different between studied and non-studied
97    patterns. If the pattern contains (*MARK) items there may also be differences,
98    for the same reason. The \fB-s\fP command line option can be overridden for
99    specific patterns that should never be studied (see the /S option below).
100  .TP 10  .TP 10
101  \fB-t\fP  \fB-t\fP
102  Run each compile, study, and match many times with a timer, and output  Run each compile, study, and match many times with a timer, and output
# Line 193  options that do not correspond to anythi Line 209  options that do not correspond to anythi
209    \fB/<bsr_unicode>\fP  PCRE_BSR_UNICODE    \fB/<bsr_unicode>\fP  PCRE_BSR_UNICODE
210  .sp  .sp
211  The modifiers that are enclosed in angle brackets are literal strings as shown,  The modifiers that are enclosed in angle brackets are literal strings as shown,
212  including the angle brackets, but the letters can be in either case. This  including the angle brackets, but the letters within can be in either case.
213  example sets multiline matching with CRLF as the line ending sequence:  This example sets multiline matching with CRLF as the line ending sequence:
214  .sp  .sp
215    /^abc/m<crlf>    /^abc/m<CRLF>
216  .sp  .sp
217  As well as turning on the PCRE_UTF8 option, the \fB/8\fP modifier also causes  As well as turning on the PCRE_UTF8 option, the \fB/8\fP modifier also causes
218  any non-printing characters in output strings to be printed using the  any non-printing characters in output strings to be printed using the
# Line 290  which it appears. Line 306  which it appears.
306  The \fB/M\fP modifier causes the size of memory block used to hold the compiled  The \fB/M\fP modifier causes the size of memory block used to hold the compiled
307  pattern to be output.  pattern to be output.
308  .P  .P
309  The \fB/S\fP modifier causes \fBpcre_study()\fP to be called after the  If the \fB/S\fP modifier appears once, it causes \fBpcre_study()\fP to be
310  expression has been compiled, and the results used when the expression is  called after the expression has been compiled, and the results used when the
311  matched.  expression is matched. If \fB/S\fP appears twice, it suppresses studying, even
312    if it was requested externally by the \fB-s\fP command line option. This makes
313    it possible to specify that certain patterns are always studied, and others are
314    never studied, independently of \fB-s\fP. This feature is used in the test
315    files in a few cases where the output is different when the pattern is studied.
316  .P  .P
317  The \fB/T\fP modifier must be followed by a single digit. It causes a specific  The \fB/T\fP modifier must be followed by a single digit. It causes a specific
318  set of built-in character tables to be passed to \fBpcre_compile()\fP. It is  set of built-in character tables to be passed to \fBpcre_compile()\fP. It is
# Line 746  characters. Line 766  characters.
766  For example:  For example:
767  .sp  .sp
768     re> </some/file     re> </some/file
769    Compiled regex loaded from /some/file    Compiled pattern loaded from /some/file
770    No study data    No study data
771  .sp  .sp
772  When the pattern has been loaded, \fBpcretest\fP proceeds to read data lines in  When the pattern has been loaded, \fBpcretest\fP proceeds to read data lines in
# Line 792  Cambridge CB2 3QH, England. Line 812  Cambridge CB2 3QH, England.
812  .rs  .rs
813  .sp  .sp
814  .nf  .nf
815  Last updated: 06 June 2011  Last updated: 02 July 2011
816  Copyright (c) 1997-2011 University of Cambridge.  Copyright (c) 1997-2011 University of Cambridge.
817  .fi  .fi

Legend:
Removed from v.611  
changed lines
  Added in v.612

webmaster@exim.org
ViewVC Help
Powered by ViewVC 1.1.12