/[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 155 by ph10, Tue Apr 24 13:36:11 2007 UTC revision 336 by ph10, Sat Apr 12 15:59:03 2008 UTC
# Line 97  that file and writes to stdout. Otherwis Line 97  that file and writes to stdout. Otherwis
97  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
98  expressions, and "data>" to prompt for data lines.  expressions, and "data>" to prompt for data lines.
99  .P  .P
100    When \fBpcretest\fP is built, a configuration option can specify that it should
101    be linked with the \fBlibreadline\fP library. When this is done, if the input
102    is from a terminal, it is read using the \fBreadline()\fP function. This
103    provides line-editing and history facilities. The output from the \fB-help\fP
104    option states whether or not \fBreadline()\fP will be used.
105    .P
106  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
107  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
108  lines to be matched against the pattern.  lines to be matched against the pattern.
# Line 157  effect as they do in Perl. For example: Line 163  effect as they do in Perl. For example:
163  The following table shows additional modifiers for setting PCRE options that do  The following table shows additional modifiers for setting PCRE options that do
164  not correspond to anything in Perl:  not correspond to anything in Perl:
165  .sp  .sp
166    \fB/A\fP          PCRE_ANCHORED    \fB/A\fP              PCRE_ANCHORED
167    \fB/C\fP          PCRE_AUTO_CALLOUT    \fB/C\fP              PCRE_AUTO_CALLOUT
168    \fB/E\fP          PCRE_DOLLAR_ENDONLY    \fB/E\fP              PCRE_DOLLAR_ENDONLY
169    \fB/f\fP          PCRE_FIRSTLINE    \fB/f\fP              PCRE_FIRSTLINE
170    \fB/J\fP          PCRE_DUPNAMES    \fB/J\fP              PCRE_DUPNAMES
171    \fB/N\fP          PCRE_NO_AUTO_CAPTURE    \fB/N\fP              PCRE_NO_AUTO_CAPTURE
172    \fB/U\fP          PCRE_UNGREEDY    \fB/U\fP              PCRE_UNGREEDY
173    \fB/X\fP          PCRE_EXTRA    \fB/X\fP              PCRE_EXTRA
174    \fB/<cr>\fP       PCRE_NEWLINE_CR    \fB/<JS>\fP           PCRE_JAVASCRIPT_COMPAT
175    \fB/<lf>\fP       PCRE_NEWLINE_LF    \fB/<cr>\fP           PCRE_NEWLINE_CR
176    \fB/<crlf>\fP     PCRE_NEWLINE_CRLF    \fB/<lf>\fP           PCRE_NEWLINE_LF
177    \fB/<anycrlf>\fP  PCRE_NEWLINE_ANYCRLF    \fB/<crlf>\fP         PCRE_NEWLINE_CRLF
178    \fB/<any>\fP      PCRE_NEWLINE_ANY    \fB/<anycrlf>\fP      PCRE_NEWLINE_ANYCRLF
179  .sp    \fB/<any>\fP          PCRE_NEWLINE_ANY
180  Those specifying line ending sequencess are literal strings as shown. This    \fB/<bsr_anycrlf>\fP  PCRE_BSR_ANYCRLF
181  example sets multiline matching with CRLF as the line ending sequence:    \fB/<bsr_unicode>\fP  PCRE_BSR_UNICODE
182    .sp
183    Those specifying line ending sequences are literal strings as shown, but the
184    letters can be in either case. This example sets multiline matching with CRLF
185    as the line ending sequence:
186  .sp  .sp
187    /^abc/m<crlf>    /^abc/m<crlf>
188  .sp  .sp
# Line 411  and \eZ, causing REG_NOTBOL and REG_NOTE Line 421  and \eZ, causing REG_NOTBOL and REG_NOTE
421  The use of \ex{hh...} to represent UTF-8 characters is not dependent on the use  The use of \ex{hh...} to represent UTF-8 characters is not dependent on the use
422  of the \fB/8\fP modifier on the pattern. It is recognized always. There may be  of the \fB/8\fP modifier on the pattern. It is recognized always. There may be
423  any number of hexadecimal digits inside the braces. The result is from one to  any number of hexadecimal digits inside the braces. The result is from one to
424  six bytes, encoded according to the UTF-8 rules.  six bytes, encoded according to the original UTF-8 rules of RFC 2279. This
425    allows for values in the range 0 to 0x7FFFFFFF. Note that not all of those are
426    valid Unicode code points, or indeed valid UTF-8 characters according to the
427    later rules in RFC 3629.
428  .  .
429  .  .
430  .SH "THE ALTERNATIVE MATCHING FUNCTION"  .SH "THE ALTERNATIVE MATCHING FUNCTION"
# Line 457  of an interactive \fBpcretest\fP run. Line 470  of an interactive \fBpcretest\fP run.
470    data> xyz    data> xyz
471    No match    No match
472  .sp  .sp
473    Note that unset capturing substrings that are not followed by one that is set
474    are not returned by \fBpcre_exec()\fP, and are not shown by \fBpcretest\fP. In
475    the following example, there are two capturing substrings, but when the first
476    data line is matched, the second, unset substring is not shown. An "internal"
477    unset substring is shown as "<unset>", as for the second data line.
478    .sp
479        re> /(a)|(b)/
480      data> a
481       0: a
482       1: a
483      data> b
484       0: b
485       1: <unset>
486       2: b
487    .sp
488  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
489  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
490  pattern. See below for the definition of non-printing characters. If the  pattern. See below for the definition of non-printing characters. If the
# Line 690  Cambridge CB2 3QH, England. Line 718  Cambridge CB2 3QH, England.
718  .rs  .rs
719  .sp  .sp
720  .nf  .nf
721  Last updated: 24 April 2007  Last updated: 12 April 2008
722  Copyright (c) 1997-2007 University of Cambridge.  Copyright (c) 1997-2008 University of Cambridge.
723  .fi  .fi

Legend:
Removed from v.155  
changed lines
  Added in v.336

  ViewVC Help
Powered by ViewVC 1.1.5