[Pcre-svn] [386] code/trunk: Add the -M option to pcretest.

Página Inicial
Delete this message
Autor: Subversion repository
Data:  
Para: pcre-svn
Assunto: [Pcre-svn] [386] code/trunk: Add the -M option to pcretest.
Revision: 386
          http://vcs.pcre.org/viewvc?view=rev&revision=386
Author:   ph10
Date:     2009-03-10 11:48:33 +0000 (Tue, 10 Mar 2009)


Log Message:
-----------
Add the -M option to pcretest.

Modified Paths:
--------------
    code/trunk/ChangeLog
    code/trunk/doc/pcretest.1
    code/trunk/pcretest.c


Modified: code/trunk/ChangeLog
===================================================================
--- code/trunk/ChangeLog    2009-03-08 16:56:58 UTC (rev 385)
+++ code/trunk/ChangeLog    2009-03-10 11:48:33 UTC (rev 386)
@@ -50,6 +50,8 @@


 11. Unicode property support in character classes was not working for 
     characters (bytes) greater than 127 when not in UTF-8 mode.
+    
+12. Added the -M command line option to pcretest. 



Version 7.8 05-Sep-08

Modified: code/trunk/doc/pcretest.1
===================================================================
--- code/trunk/doc/pcretest.1    2009-03-08 16:56:58 UTC (rev 385)
+++ code/trunk/doc/pcretest.1    2009-03-10 11:48:33 UTC (rev 386)
@@ -49,6 +49,11 @@
 Behave as if each regex has the \fB/I\fP modifier; information about the
 compiled pattern is given after compilation.
 .TP 10
+\fB-M\fP
+Behave as if each data line contains the \eM escape sequence; this causes
+PCRE to discover the minimum MATCH_LIMIT and MATCH_LIMIT_RECURSION settings by 
+calling \fBpcre_exec()\fP repeatedly with different limits.
+.TP 10
 \fB-m\fP
 Output the size of each compiled pattern after it has been compiled. This is
 equivalent to adding \fB/M\fP to each regular expression. For compatibility
@@ -718,6 +723,6 @@
 .rs
 .sp
 .nf
-Last updated: 12 April 2008
-Copyright (c) 1997-2008 University of Cambridge.
+Last updated: 10 March 2009
+Copyright (c) 1997-2009 University of Cambridge.
 .fi


Modified: code/trunk/pcretest.c
===================================================================
--- code/trunk/pcretest.c    2009-03-08 16:56:58 UTC (rev 385)
+++ code/trunk/pcretest.c    2009-03-10 11:48:33 UTC (rev 386)
@@ -785,6 +785,7 @@
 #endif
 printf("  -help    show usage information\n");
 printf("  -i       show information about compiled patterns\n"
+       "  -M       find MATCH_LIMIT minimum for each subject\n"
        "  -m       output memory used information\n"
        "  -o <n>   set size of offsets vector to <n>\n");
 #if !defined NOPOSIX
@@ -814,6 +815,7 @@
 FILE *infile = stdin;
 int options = 0;
 int study_options = 0;
+int default_find_match_limit = FALSE;
 int op = 1;
 int timeit = 0;
 int timeitm = 0;
@@ -873,6 +875,7 @@
   else if (strcmp(argv[op], "-b") == 0) debug = 1;
   else if (strcmp(argv[op], "-i") == 0) showinfo = 1;
   else if (strcmp(argv[op], "-d") == 0) showinfo = debug = 1;
+  else if (strcmp(argv[op], "-M") == 0) default_find_match_limit = TRUE; 
 #if !defined NODFA
   else if (strcmp(argv[op], "-dfa") == 0) all_use_dfa = 1;
 #endif
@@ -1709,7 +1712,7 @@
     int callout_data_set = 0;
     int count, c;
     int copystrings = 0;
-    int find_match_limit = 0;
+    int find_match_limit = default_find_match_limit;
     int getstrings = 0;
     int getlist = 0;
     int gmatched = 0;