/[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 579 by ph10, Wed Nov 24 17:39:25 2010 UTC revision 598 by ph10, Sat May 7 15:37:31 2011 UTC
# Line 507  found. This is always the shortest possi Line 507  found. This is always the shortest possi
507  This section describes the output when the normal matching function,  This section describes the output when the normal matching function,
508  \fBpcre_exec()\fP, is being used.  \fBpcre_exec()\fP, is being used.
509  .P  .P
510  When a match succeeds, pcretest outputs the list of captured substrings that  When a match succeeds, \fBpcretest\fP outputs the list of captured substrings
511  \fBpcre_exec()\fP returns, starting with number 0 for the string that matched  that \fBpcre_exec()\fP returns, starting with number 0 for the string that
512  the whole pattern. Otherwise, it outputs "No match" when the return is  matched the whole pattern. Otherwise, it outputs "No match" when the return is
513  PCRE_ERROR_NOMATCH, and "Partial match:" followed by the partially matching  PCRE_ERROR_NOMATCH, and "Partial match:" followed by the partially matching
514  substring when \fBpcre_exec()\fP returns PCRE_ERROR_PARTIAL. (Note that this is  substring when \fBpcre_exec()\fP returns PCRE_ERROR_PARTIAL. (Note that this is
515  the entire substring that was inspected during the partial match; it may  the entire substring that was inspected during the partial match; it may
516  include characters before the actual match start if a lookbehind assertion,  include characters before the actual match start if a lookbehind assertion,
517  \eK, \eb, or \eB was involved.) For any other returns, it outputs the PCRE  \eK, \eb, or \eB was involved.) For any other return, \fBpcretest\fP outputs
518  negative error number. Here is an example of an interactive \fBpcretest\fP run.  the PCRE negative error number and a short descriptive phrase. If the error is
519    a failed UTF-8 string check, the byte offset of the start of the failing
520    character and the reason code are also output, provided that the size of the
521    output vector is at least two. Here is an example of an interactive
522    \fBpcretest\fP run.
523  .sp  .sp
524    $ pcretest    $ pcretest
525    PCRE version 7.0 30-Nov-2006    PCRE version 8.13 2011-04-30
526  .sp  .sp
527      re> /^abc(\ed+)/      re> /^abc(\ed+)/
528    data> abc123    data> abc123
# Line 527  negative error number. Here is an exampl Line 531  negative error number. Here is an exampl
531    data> xyz    data> xyz
532    No match    No match
533  .sp  .sp
534  Note that unset capturing substrings that are not followed by one that is set  Unset capturing substrings that are not followed by one that is set are not
535  are not returned by \fBpcre_exec()\fP, and are not shown by \fBpcretest\fP. In  returned by \fBpcre_exec()\fP, and are not shown by \fBpcretest\fP. In the
536  the following example, there are two capturing substrings, but when the first  following example, there are two capturing substrings, but when the first data
537  data line is matched, the second, unset substring is not shown. An "internal"  line is matched, the second, unset substring is not shown. An "internal" unset
538  unset substring is shown as "<unset>", as for the second data line.  substring is shown as "<unset>", as for the second data line.
539  .sp  .sp
540      re> /(a)|(b)/      re> /(a)|(b)/
541    data> a    data> a
# Line 565  matching attempts are output in sequence Line 569  matching attempts are output in sequence
569     0: ipp     0: ipp
570     1: pp     1: pp
571  .sp  .sp
572  "No match" is output only if the first match attempt fails.  "No match" is output only if the first match attempt fails. Here is an example
573    of a failure message (the offset 4 that is specified by \e>4 is past the end of
574    the subject string):
575    .sp
576        re> /xyz/
577      data> xyz\>4
578      Error -24 (bad offset value)
579  .P  .P
580  If any of the sequences \fB\eC\fP, \fB\eG\fP, or \fB\eL\fP are present in a  If any of the sequences \fB\eC\fP, \fB\eG\fP, or \fB\eL\fP are present in a
581  data line that is successfully matched, the substrings extracted by the  data line that is successfully matched, the substrings extracted by the
# Line 779  Cambridge CB2 3QH, England. Line 789  Cambridge CB2 3QH, England.
789  .rs  .rs
790  .sp  .sp
791  .nf  .nf
792  Last updated: 21 November 2010  Last updated: 06 May 2011
793  Copyright (c) 1997-2010 University of Cambridge.  Copyright (c) 1997-2011 University of Cambridge.
794  .fi  .fi

Legend:
Removed from v.579  
changed lines
  Added in v.598

  ViewVC Help
Powered by ViewVC 1.1.5