summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>2009-03-10 11:48:33 +0000
committerph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>2009-03-10 11:48:33 +0000
commit41dc6522985faac752eaca03af3164ef12f13f3b (patch)
tree255643c4bb3fc2811c33ba59b5ea6b5061b20294
parent93fe69f518b21b77fd329544a82f951a0cefce5b (diff)
downloadpcre-41dc6522985faac752eaca03af3164ef12f13f3b.tar.gz
Add the -M option to pcretest.
git-svn-id: svn://vcs.exim.org/pcre/code/trunk@386 2f5784b3-3f2a-0410-8824-cb99058d5e15
-rw-r--r--ChangeLog2
-rw-r--r--doc/pcretest.19
-rw-r--r--pcretest.c5
3 files changed, 13 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index ecd3004..668e2a6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -50,6 +50,8 @@ Version 7.9 xx-xxx-09
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
diff --git a/doc/pcretest.1 b/doc/pcretest.1
index 8efdbe6..56b677e 100644
--- a/doc/pcretest.1
+++ b/doc/pcretest.1
@@ -49,6 +49,11 @@ Output a brief summary these options and then exit.
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 @@ Cambridge CB2 3QH, England.
.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
diff --git a/pcretest.c b/pcretest.c
index 77b24dd..8dd6333 100644
--- a/pcretest.c
+++ b/pcretest.c
@@ -785,6 +785,7 @@ printf(" -dfa force DFA matching for all subjects\n");
#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 @@ int main(int argc, char **argv)
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 @@ while (argc > 1 && argv[op][0] == '-')
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 @@ while (!done)
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;