diff options
author | nigel <nigel@2f5784b3-3f2a-0410-8824-cb99058d5e15> | 2007-02-24 21:38:05 +0000 |
---|---|---|
committer | nigel <nigel@2f5784b3-3f2a-0410-8824-cb99058d5e15> | 2007-02-24 21:38:05 +0000 |
commit | e390bd8b72ea8a359349a0d3ec2061289dc65b56 (patch) | |
tree | d43c709b85e1b60c1764778854e1417191d26364 | |
parent | beb7de117d08845a5d039d4ad4ffab8f5bac61fe (diff) | |
download | pcre-e390bd8b72ea8a359349a0d3ec2061289dc65b56.tar.gz |
Load pcre-1.01 into code/trunk.
git-svn-id: svn://vcs.exim.org/pcre/code/trunk@5 2f5784b3-3f2a-0410-8824-cb99058d5e15
-rw-r--r-- | ChangeLog | 20 | ||||
-rw-r--r-- | internal.h | 2 | ||||
-rw-r--r-- | pcre.3 | 2 | ||||
-rw-r--r-- | pcre.c | 10 | ||||
-rw-r--r-- | testinput2 | 22 | ||||
-rw-r--r-- | testoutput | 2 | ||||
-rw-r--r-- | testoutput2 | 35 |
7 files changed, 86 insertions, 7 deletions
@@ -1,6 +1,26 @@ ChangeLog for PCRE ------------------ + +Version 1.01 19-Nov-97 +---------------------- + +1. PCRE was failing to diagnose unlimited repeat of empty string for patterns +like /([ab]*)*/, that is, for classes with more than one character in them. + +2. Likewise, it wasn't diagnosing patterns with "once-only" subpatterns, such +as /((?>a*))*/ (a PCRE_EXTRA facility). + + +Version 1.00 18-Nov-97 +---------------------- + +1. Added compile-time macros to support systems such as SunOS4 which don't have +memmove() or strerror() but have other things that can be used instead. + +2. Arranged that "make clean" removes the executables. + + Version 0.99 27-Oct-97 ---------------------- @@ -3,7 +3,7 @@ *************************************************/ -#define PCRE_VERSION "1.00 18-Nov-1997" +#define PCRE_VERSION "1.01 19-Nov-1997" /* This is a library of functions to support regular expressions whose syntax @@ -924,7 +924,7 @@ With both maximizing and minimizing repetition, failure of what follows normally causes the repeated item to be re-evaluated to see if a different number of repeats allows the rest of the pattern to match. Sometimes it is useful to prevent this, either to change the nature of the match, or to cause -it fail earlier than it otherwise might when the author or the pattern knows +it fail earlier than it otherwise might when the author of the pattern knows there is no point in carrying on. Consider, for example, the pattern \\d+foo when applied to the subject line @@ -228,7 +228,7 @@ do { /* Test an embedded subpattern; if it could not be empty, break the loop. Otherwise carry on in the branch. */ - if ((int)(*cc) >= OP_BRA) + if ((int)(*cc) >= OP_BRA || (int)(*cc) == OP_ONCE) { if (!could_be_empty(cc)) break; do cc += (cc[1] << 8) + cc[2]; while (*cc == OP_ALT); @@ -272,6 +272,10 @@ do { case OP_MINSTAR: case OP_QUERY: case OP_MINQUERY: + case OP_NOTSTAR: + case OP_NOTMINSTAR: + case OP_NOTQUERY: + case OP_NOTMINQUERY: case OP_TYPESTAR: case OP_TYPEMINSTAR: case OP_TYPEQUERY: @@ -292,7 +296,7 @@ do { case OP_CLASS: case OP_REF: - cc += (*cc == OP_REF)? 2 : 4 + 2 * cc[2] + cc[3]; + cc += (*cc == OP_REF)? 2 : 33; switch (*cc) { @@ -2360,7 +2364,7 @@ for (;;) /* "Once" brackets are like assertion brackets except that after a match, the point in the subject string is not moved back. Thus there can never be - a back into the brackets. Check the alternative branches in turn - the + a move back into the brackets. Check the alternative branches in turn - the matching won't pass the KET for this kind of subpattern. If any one branch matches, we carry on, leaving the subject pointer. */ @@ -241,4 +241,26 @@ *** Failers 12345+ +/([a]*)*/ + +/([ab]*)*/ + +/([^a]*)*/ + +/([^ab]*)*/ + +/([a]*?)*/ + +/([ab]*?)*/ + +/([^a]*?)*/ + +/([^ab]*?)*/ + +/(?>a*)*/X + +/((?>a*))*/X + +/((?>a*?))*/X + / End of test input / @@ -1,5 +1,5 @@ Testing Perl-Compatible Regular Expressions -PCRE version 1.00 18-Nov-1997 +PCRE version 1.01 19-Nov-1997 /the quick brown fox/ the quick brown fox diff --git a/testoutput2 b/testoutput2 index ec09561..872b73f 100644 --- a/testoutput2 +++ b/testoutput2 @@ -1,5 +1,5 @@ Testing Perl-Compatible Regular Expressions -PCRE version 1.00 18-Nov-1997 +PCRE version 1.01 19-Nov-1997 /(a)b|/ Identifying subpattern count = 1 @@ -566,6 +566,39 @@ No match 12345+ No match +/([a]*)*/ +Failed: operand of unlimited repeat could match the empty string at offset 6 + +/([ab]*)*/ +Failed: operand of unlimited repeat could match the empty string at offset 7 + +/([^a]*)*/ +Failed: operand of unlimited repeat could match the empty string at offset 7 + +/([^ab]*)*/ +Failed: operand of unlimited repeat could match the empty string at offset 8 + +/([a]*?)*/ +Failed: operand of unlimited repeat could match the empty string at offset 7 + +/([ab]*?)*/ +Failed: operand of unlimited repeat could match the empty string at offset 8 + +/([^a]*?)*/ +Failed: operand of unlimited repeat could match the empty string at offset 8 + +/([^ab]*?)*/ +Failed: operand of unlimited repeat could match the empty string at offset 9 + +/(?>a*)*/X +Failed: nothing to repeat at offset 6 + +/((?>a*))*/X +Failed: operand of unlimited repeat could match the empty string at offset 8 + +/((?>a*?))*/X +Failed: operand of unlimited repeat could match the empty string at offset 9 + / End of test input / Identifying subpattern count = 0 No options |