/[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 435 by ph10, Sat Sep 5 10:20:44 2009 UTC revision 510 by ph10, Sat Mar 27 17:45:29 2010 UTC
# Line 211  substring. This makes a difference to th Line 211  substring. This makes a difference to th
211  begins with a lookbehind assertion (including \eb or \eB).  begins with a lookbehind assertion (including \eb or \eB).
212  .P  .P
213  If any call to \fBpcre_exec()\fP in a \fB/g\fP or \fB/G\fP sequence matches an  If any call to \fBpcre_exec()\fP in a \fB/g\fP or \fB/G\fP sequence matches an
214  empty string, the next call is done with the PCRE_NOTEMPTY and PCRE_ANCHORED  empty string, the next call is done with the PCRE_NOTEMPTY_ATSTART and
215  flags set in order to search for another, non-empty, match at the same point.  PCRE_ANCHORED flags set in order to search for another, non-empty, match at the
216  If this second match fails, the start offset is advanced by one, and the normal  same point. If this second match fails, the start offset is advanced by one
217  match is retried. This imitates the way Perl handles such cases when using the  character, and the normal match is retried. This imitates the way Perl handles
218  \fB/g\fP modifier or the \fBsplit()\fP function.  such cases when using the \fB/g\fP modifier or the \fBsplit()\fP function.
219  .  .
220  .  .
221  .SS "Other modifiers"  .SS "Other modifiers"
# Line 224  match is retried. This imitates the way Line 224  match is retried. This imitates the way
224  There are yet more modifiers for controlling the way \fBpcretest\fP  There are yet more modifiers for controlling the way \fBpcretest\fP
225  operates.  operates.
226  .P  .P
227    The \fB/8\fP modifier causes \fBpcretest\fP to call PCRE with the PCRE_UTF8
228    option set. This turns on support for UTF-8 character handling in PCRE,
229    provided that it was compiled with this support enabled. This modifier also
230    causes any non-printing characters in output strings to be printed using the
231    \ex{hh...} notation if they are valid UTF-8 sequences.
232    .P
233    If the \fB/?\fP modifier is used with \fB/8\fP, it causes \fBpcretest\fP to
234    call \fBpcre_compile()\fP with the PCRE_NO_UTF8_CHECK option, to suppress the
235    checking of the string for UTF-8 validity.
236    .P
237  The \fB/+\fP modifier requests that as well as outputting the substring that  The \fB/+\fP modifier requests that as well as outputting the substring that
238  matched the entire pattern, pcretest should in addition output the remainder of  matched the entire pattern, pcretest should in addition output the remainder of
239  the subject string. This is useful for tests where the subject contains  the subject string. This is useful for tests where the subject contains
# Line 236  also present, this data is replaced by s Line 246  also present, this data is replaced by s
246  use in the automatic test scripts; it ensures that the same output is generated  use in the automatic test scripts; it ensures that the same output is generated
247  for different internal link sizes.  for different internal link sizes.
248  .P  .P
 The \fB/L\fP modifier must be followed directly by the name of a locale, for  
 example,  
 .sp  
   /pattern/Lfr_FR  
 .sp  
 For this reason, it must be the last modifier. The given locale is set,  
 \fBpcre_maketables()\fP is called to build a set of character tables for the  
 locale, and this is then passed to \fBpcre_compile()\fP when compiling the  
 regular expression. Without an \fB/L\fP modifier, NULL is passed as the tables  
 pointer; that is, \fB/L\fP applies only to the expression on which it appears.  
 .P  
 The \fB/I\fP modifier requests that \fBpcretest\fP output information about the  
 compiled pattern (whether it is anchored, has a fixed first character, and  
 so on). It does this by calling \fBpcre_fullinfo()\fP after compiling a  
 pattern. If the pattern is studied, the results of that are also output.  
 .P  
249  The \fB/D\fP modifier is a PCRE debugging feature, and is equivalent to  The \fB/D\fP modifier is a PCRE debugging feature, and is equivalent to
250  \fB/BI\fP, that is, both the \fB/B\fP and the \fB/I\fP modifiers.  \fB/BI\fP, that is, both the \fB/B\fP and the \fB/I\fP modifiers.
251  .P  .P
# Line 263  available when the POSIX interface to PC Line 257  available when the POSIX interface to PC
257  \fB/P\fP pattern modifier is specified. See also the section about saving and  \fB/P\fP pattern modifier is specified. See also the section about saving and
258  reloading compiled patterns below.  reloading compiled patterns below.
259  .P  .P
260  The \fB/S\fP modifier causes \fBpcre_study()\fP to be called after the  The \fB/I\fP modifier requests that \fBpcretest\fP output information about the
261  expression has been compiled, and the results used when the expression is  compiled pattern (whether it is anchored, has a fixed first character, and
262  matched.  so on). It does this by calling \fBpcre_fullinfo()\fP after compiling a
263    pattern. If the pattern is studied, the results of that are also output.
264    .P
265    The \fB/K\fP modifier requests \fBpcretest\fP to show names from backtracking
266    control verbs that are returned from calls to \fBpcre_exec()\fP. It causes
267    \fBpcretest\fP to create a \fBpcre_extra\fP block if one has not already been
268    created by a call to \fBpcre_study()\fP, and to set the PCRE_EXTRA_MARK flag
269    and the \fBmark\fP field within it, every time that \fBpcre_exec()\fP is
270    called. If the variable that the \fBmark\fP field points to is non-NULL for a
271    match, non-match, or partial match, \fBpcretest\fP prints the string to which
272    it points. For a match, this is shown on a line by itself, tagged with "MK:".
273    For a non-match it is added to the message.
274    .P
275    The \fB/L\fP modifier must be followed directly by the name of a locale, for
276    example,
277    .sp
278      /pattern/Lfr_FR
279    .sp
280    For this reason, it must be the last modifier. The given locale is set,
281    \fBpcre_maketables()\fP is called to build a set of character tables for the
282    locale, and this is then passed to \fBpcre_compile()\fP when compiling the
283    regular expression. Without an \fB/L\fP modifier, NULL is passed as the tables
284    pointer; that is, \fB/L\fP applies only to the expression on which it appears.
285  .P  .P
286  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
287  pattern to be output.  pattern to be output.
# Line 276  API rather than its native API. When thi Line 292  API rather than its native API. When thi
292  present, and REG_NEWLINE is set if \fB/m\fP is present. The wrapper functions  present, and REG_NEWLINE is set if \fB/m\fP is present. The wrapper functions
293  force PCRE_DOLLAR_ENDONLY always, and PCRE_DOTALL unless REG_NEWLINE is set.  force PCRE_DOLLAR_ENDONLY always, and PCRE_DOTALL unless REG_NEWLINE is set.
294  .P  .P
295  The \fB/8\fP modifier causes \fBpcretest\fP to call PCRE with the PCRE_UTF8  The \fB/S\fP modifier causes \fBpcre_study()\fP to be called after the
296  option set. This turns on support for UTF-8 character handling in PCRE,  expression has been compiled, and the results used when the expression is
297  provided that it was compiled with this support enabled. This modifier also  matched.
 causes any non-printing characters in output strings to be printed using the  
 \ex{hh...} notation if they are valid UTF-8 sequences.  
 .P  
 If the \fB/?\fP modifier is used with \fB/8\fP, it causes \fBpcretest\fP to  
 call \fBpcre_compile()\fP with the PCRE_NO_UTF8_CHECK option, to suppress the  
 checking of the string for UTF-8 validity.  
298  .  .
299  .  .
300  .SH "DATA LINES"  .SH "DATA LINES"
# Line 356  recognized: Line 366  recognized:
366                 MATCH_LIMIT_RECURSION settings                 MATCH_LIMIT_RECURSION settings
367  .\" JOIN  .\" JOIN
368    \eN         pass the PCRE_NOTEMPTY option to \fBpcre_exec()\fP    \eN         pass the PCRE_NOTEMPTY option to \fBpcre_exec()\fP
369                 or \fBpcre_dfa_exec()\fP                 or \fBpcre_dfa_exec()\fP; if used twice, pass the
370                   PCRE_NOTEMPTY_ATSTART option
371  .\" JOIN  .\" JOIN
372    \eOdd       set the size of the output vector passed to    \eOdd       set the size of the output vector passed to
373                 \fBpcre_exec()\fP to dd (any number of digits)                 \fBpcre_exec()\fP to dd (any number of digits)
374  .\" JOIN  .\" JOIN
375    \eP         pass the PCRE_PARTIAL_SOFT option to \fBpcre_exec()\fP    \eP         pass the PCRE_PARTIAL_SOFT option to \fBpcre_exec()\fP
376                 or \fBpcre_dfa_exec()\fP; if used twice, pass the                 or \fBpcre_dfa_exec()\fP; if used twice, pass the
377                 PCRE_PARTIAL_HARD option                 PCRE_PARTIAL_HARD option
378  .\" JOIN  .\" JOIN
379    \eQdd       set the PCRE_MATCH_LIMIT_RECURSION limit to dd    \eQdd       set the PCRE_MATCH_LIMIT_RECURSION limit to dd
380                 (any number of digits)                 (any number of digits)
381    \eR         pass the PCRE_DFA_RESTART option to \fBpcre_dfa_exec()\fP    \eR         pass the PCRE_DFA_RESTART option to \fBpcre_dfa_exec()\fP
382    \eS         output details of memory get/free calls during matching    \eS         output details of memory get/free calls during matching
383  .\" JOIN  .\" JOIN
384      \eY         pass the PCRE_NO_START_OPTIMIZE option to \fBpcre_exec()\fP
385                   or \fBpcre_dfa_exec()\fP
386    .\" JOIN
387    \eZ         pass the PCRE_NOTEOL option to \fBpcre_exec()\fP    \eZ         pass the PCRE_NOTEOL option to \fBpcre_exec()\fP
388                 or \fBpcre_dfa_exec()\fP                 or \fBpcre_dfa_exec()\fP
389  .\" JOIN  .\" JOIN
# Line 547  the subject where there is at least one Line 561  the subject where there is at least one
561  .sp  .sp
562  (Using the normal matching function on this data finds only "tang".) The  (Using the normal matching function on this data finds only "tang".) The
563  longest matching string is always given first (and numbered zero). After a  longest matching string is always given first (and numbered zero). After a
564  PCRE_ERROR_PARTIAL return, the output is "Partial match:", followed by the  PCRE_ERROR_PARTIAL return, the output is "Partial match:", followed by the
565  partially matching substring.  partially matching substring.
566  .P  .P
567  If \fB/g\fP is present on the pattern, the search for further matches resumes  If \fB/g\fP is present on the pattern, the search for further matches resumes
# Line 727  Cambridge CB2 3QH, England. Line 741  Cambridge CB2 3QH, England.
741  .rs  .rs
742  .sp  .sp
743  .nf  .nf
744  Last updated: 05 September 2009  Last updated: 26 March 2010
745  Copyright (c) 1997-2009 University of Cambridge.  Copyright (c) 1997-2010 University of Cambridge.
746  .fi  .fi

Legend:
Removed from v.435  
changed lines
  Added in v.510

webmaster@exim.org
ViewVC Help
Powered by ViewVC 1.1.12