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

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

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

revision 511 by ph10, Mon Oct 5 10:59:35 2009 UTC revision 512 by ph10, Tue Mar 30 11:11:52 2010 UTC
# Line 207  PATTERN MODIFIERS Line 207  PATTERN MODIFIERS
207    
208         There are yet more modifiers for controlling the way pcretest operates.         There are yet more modifiers for controlling the way pcretest operates.
209    
210           The  /8 modifier causes pcretest to call PCRE with the PCRE_UTF8 option
211           set. This turns on support for UTF-8 character handling in  PCRE,  pro-
212           vided  that  it  was  compiled with this support enabled. This modifier
213           also causes any non-printing characters in output strings to be printed
214           using the \x{hh...} notation if they are valid UTF-8 sequences.
215    
216           If  the  /?  modifier  is  used  with  /8,  it  causes pcretest to call
217           pcre_compile() with the  PCRE_NO_UTF8_CHECK  option,  to  suppress  the
218           checking of the string for UTF-8 validity.
219    
220         The  /+ modifier requests that as well as outputting the substring that         The  /+ modifier requests that as well as outputting the substring that
221         matched the entire pattern, pcretest  should  in  addition  output  the         matched the entire pattern, pcretest  should  in  addition  output  the
222         remainder  of  the  subject  string. This is useful for tests where the         remainder  of  the  subject  string. This is useful for tests where the
# Line 219  PATTERN MODIFIERS Line 229  PATTERN MODIFIERS
229         feature for use in the automatic test scripts; it ensures that the same         feature for use in the automatic test scripts; it ensures that the same
230         output is generated for different internal link sizes.         output is generated for different internal link sizes.
231    
        The  /L modifier must be followed directly by the name of a locale, for  
        example,  
   
          /pattern/Lfr_FR  
   
        For this reason, it must be the last modifier. The given locale is set,  
        pcre_maketables()  is called to build a set of character tables for the  
        locale, and this is then passed to pcre_compile()  when  compiling  the  
        regular  expression.  Without  an  /L  modifier,  NULL is passed as the  
        tables pointer; that is, /L applies only to the expression on which  it  
        appears.  
   
        The  /I  modifier  requests  that pcretest output information about the  
        compiled pattern (whether it is anchored, has a fixed first  character,  
        and  so  on). It does this by calling pcre_fullinfo() after compiling a  
        pattern. If the pattern is studied, the results of that are  also  out-  
        put.  
   
232         The  /D modifier is a PCRE debugging feature, and is equivalent to /BI,         The  /D modifier is a PCRE debugging feature, and is equivalent to /BI,
233         that is, both the /B and the /I modifiers.         that is, both the /B and the /I modifiers.
234    
# Line 248  PATTERN MODIFIERS Line 240  PATTERN MODIFIERS
240         used,  that is, when the /P pattern modifier is specified. See also the         used,  that is, when the /P pattern modifier is specified. See also the
241         section about saving and reloading compiled patterns below.         section about saving and reloading compiled patterns below.
242    
243         The /S modifier causes pcre_study() to be called after  the  expression         The /I modifier requests that pcretest  output  information  about  the
244         has been compiled, and the results used when the expression is matched.         compiled  pattern (whether it is anchored, has a fixed first character,
245           and so on). It does this by calling pcre_fullinfo() after  compiling  a
246           pattern.  If  the pattern is studied, the results of that are also out-
247           put.
248    
249           The /K modifier requests pcretest to show names from backtracking  con-
250           trol  verbs  that  are  returned  from  calls to pcre_exec(). It causes
251           pcretest to create a pcre_extra block if one has not already been  cre-
252           ated by a call to pcre_study(), and to set the PCRE_EXTRA_MARK flag and
253           the mark field within it, every time that pcre_exec() is called. If the
254           variable  that  the  mark field points to is non-NULL for a match, non-
255           match, or partial match, pcretest prints the string to which it points.
256           For a match, this is shown on a line by itself, tagged with "MK:".  For
257           a non-match it is added to the message.
258    
259           The /L modifier must be followed directly by the name of a locale,  for
260           example,
261    
262             /pattern/Lfr_FR
263    
264           For this reason, it must be the last modifier. The given locale is set,
265           pcre_maketables() is called to build a set of character tables for  the
266           locale,  and  this  is then passed to pcre_compile() when compiling the
267           regular expression. Without an /L  modifier,  NULL  is  passed  as  the
268           tables  pointer; that is, /L applies only to the expression on which it
269           appears.
270    
271         The  /M  modifier causes the size of memory block used to hold the com-         The /M modifier causes the size of memory block used to hold  the  com-
272         piled pattern to be output.         piled pattern to be output.
273    
274         The /P modifier causes pcretest to call PCRE via the POSIX wrapper  API         The  /P modifier causes pcretest to call PCRE via the POSIX wrapper API
275         rather  than  its  native  API.  When this is done, all other modifiers         rather than its native API. When this  is  done,  all  other  modifiers
276         except /i, /m, and /+ are ignored. REG_ICASE is set if /i  is  present,         except  /i,  /m, and /+ are ignored. REG_ICASE is set if /i is present,
277         and  REG_NEWLINE  is  set if /m is present. The wrapper functions force         and REG_NEWLINE is set if /m is present. The  wrapper  functions  force
278         PCRE_DOLLAR_ENDONLY always, and PCRE_DOTALL unless REG_NEWLINE is set.         PCRE_DOLLAR_ENDONLY always, and PCRE_DOTALL unless REG_NEWLINE is set.
279    
280         The /8 modifier causes pcretest to call PCRE with the PCRE_UTF8  option         The  /S  modifier causes pcre_study() to be called after the expression
281         set.  This  turns on support for UTF-8 character handling in PCRE, pro-         has been compiled, and the results used when the expression is matched.
        vided that it was compiled with this  support  enabled.  This  modifier  
        also causes any non-printing characters in output strings to be printed  
        using the \x{hh...} notation if they are valid UTF-8 sequences.  
   
        If the /? modifier  is  used  with  /8,  it  causes  pcretest  to  call  
        pcre_compile()  with  the  PCRE_NO_UTF8_CHECK  option,  to suppress the  
        checking of the string for UTF-8 validity.  
282    
283    
284  DATA LINES  DATA LINES
# Line 663  AUTHOR Line 673  AUTHOR
673    
674  REVISION  REVISION
675    
676         Last updated: 26 September 2009         Last updated: 26 March 2010
677         Copyright (c) 1997-2009 University of Cambridge.         Copyright (c) 1997-2010 University of Cambridge.

Legend:
Removed from v.511  
changed lines
  Added in v.512

webmaster@exim.org
ViewVC Help
Powered by ViewVC 1.1.12