Revision: 1145
http://www.exim.org/viewvc/pcre2?view=rev&revision=1145
Author: ph10
Date: 2019-07-28 16:32:11 +0100 (Sun, 28 Jul 2019)
Log Message:
-----------
Documentation and test update.
Modified Paths:
--------------
code/trunk/doc/html/pcre2pattern.html
code/trunk/doc/pcre2.txt
code/trunk/doc/pcre2pattern.3
code/trunk/testdata/testinput2
code/trunk/testdata/testoutput2
Modified: code/trunk/doc/html/pcre2pattern.html
===================================================================
--- code/trunk/doc/html/pcre2pattern.html 2019-07-23 16:58:57 UTC (rev 1144)
+++ code/trunk/doc/html/pcre2pattern.html 2019-07-28 15:32:11 UTC (rev 1145)
@@ -3758,13 +3758,22 @@
</P>
<P>
The remaining verbs act only when a later failure causes a backtrack to
-reach them. This means that their effect is confined to the assertion,
-because lookaround assertions are atomic. A backtrack that occurs after an
-assertion is complete does not jump back into the assertion. Note in particular
-that a (*MARK) name that is set in an assertion is not "seen" by an instance of
-(*SKIP:NAME) latter in the pattern.
+reach them. This means that, for the Perl-compatible assertions, their effect
+is confined to the assertion, because Perl lookaround assertions are atomic. A
+backtrack that occurs after such an assertion is complete does not jump back
+into the assertion. Note in particular that a (*MARK) name that is set in an
+assertion is not "seen" by an instance of (*SKIP:NAME) later in the pattern.
</P>
<P>
+PCRE2 now supports non-atomic positive assertions, as described in the section
+entitled
+<a href="#nonatomicassertions"> "Non-atomic assertions"</a>
+above. These assertions must be standalone (not used as conditions). They are
+not Perl-compatible. For these assertions, a later backtrack does jump back
+into the assertion, and therefore verbs such as (*COMMIT) can be triggered by
+backtracks from later in the pattern.
+</P>
+<P>
The effect of (*THEN) is not allowed to escape beyond an assertion. If there
are no more branches to try, (*THEN) causes a positive assertion to be false,
and a negative assertion to be true.
@@ -3820,7 +3829,7 @@
</P>
<br><a name="SEC32" href="#TOC1">REVISION</a><br>
<P>
-Last updated: 13 July 2019
+Last updated: 28 July 2019
<br>
Copyright © 1997-2019 University of Cambridge.
<br>
Modified: code/trunk/doc/pcre2.txt
===================================================================
--- code/trunk/doc/pcre2.txt 2019-07-23 16:58:57 UTC (rev 1144)
+++ code/trunk/doc/pcre2.txt 2019-07-28 15:32:11 UTC (rev 1145)
@@ -9439,12 +9439,20 @@
substrings are retained in both cases.
The remaining verbs act only when a later failure causes a backtrack to
- reach them. This means that their effect is confined to the assertion,
- because lookaround assertions are atomic. A backtrack that occurs after
- an assertion is complete does not jump back into the assertion. Note in
- particular that a (*MARK) name that is set in an assertion is not
- "seen" by an instance of (*SKIP:NAME) latter in the pattern.
+ reach them. This means that, for the Perl-compatible assertions, their
+ effect is confined to the assertion, because Perl lookaround assertions
+ are atomic. A backtrack that occurs after such an assertion is complete
+ does not jump back into the assertion. Note in particular that a
+ (*MARK) name that is set in an assertion is not "seen" by an instance
+ of (*SKIP:NAME) later in the pattern.
+ PCRE2 now supports non-atomic positive assertions, as described in the
+ section entitled "Non-atomic assertions" above. These assertions must
+ be standalone (not used as conditions). They are not Perl-compatible.
+ For these assertions, a later backtrack does jump back into the asser-
+ tion, and therefore verbs such as (*COMMIT) can be triggered by back-
+ tracks from later in the pattern.
+
The effect of (*THEN) is not allowed to escape beyond an assertion. If
there are no more branches to try, (*THEN) causes a positive assertion
to be false, and a negative assertion to be true.
@@ -9494,7 +9502,7 @@
REVISION
- Last updated: 13 July 2019
+ Last updated: 28 July 2019
Copyright (c) 1997-2019 University of Cambridge.
------------------------------------------------------------------------------
Modified: code/trunk/doc/pcre2pattern.3
===================================================================
--- code/trunk/doc/pcre2pattern.3 2019-07-23 16:58:57 UTC (rev 1144)
+++ code/trunk/doc/pcre2pattern.3 2019-07-28 15:32:11 UTC (rev 1145)
@@ -1,4 +1,4 @@
-.TH PCRE2PATTERN 3 "13 July 2019" "PCRE2 10.34"
+.TH PCRE2PATTERN 3 "28 July 2019" "PCRE2 10.34"
.SH NAME
PCRE2 - Perl-compatible regular expressions (revised API)
.SH "PCRE2 REGULAR EXPRESSION DETAILS"
@@ -3796,12 +3796,23 @@
retained in both cases.
.P
The remaining verbs act only when a later failure causes a backtrack to
-reach them. This means that their effect is confined to the assertion,
-because lookaround assertions are atomic. A backtrack that occurs after an
-assertion is complete does not jump back into the assertion. Note in particular
-that a (*MARK) name that is set in an assertion is not "seen" by an instance of
-(*SKIP:NAME) latter in the pattern.
+reach them. This means that, for the Perl-compatible assertions, their effect
+is confined to the assertion, because Perl lookaround assertions are atomic. A
+backtrack that occurs after such an assertion is complete does not jump back
+into the assertion. Note in particular that a (*MARK) name that is set in an
+assertion is not "seen" by an instance of (*SKIP:NAME) later in the pattern.
.P
+PCRE2 now supports non-atomic positive assertions, as described in the section
+entitled
+.\" HTML <a href="#nonatomicassertions">
+.\" </a>
+"Non-atomic assertions"
+.\"
+above. These assertions must be standalone (not used as conditions). They are
+not Perl-compatible. For these assertions, a later backtrack does jump back
+into the assertion, and therefore verbs such as (*COMMIT) can be triggered by
+backtracks from later in the pattern.
+.P
The effect of (*THEN) is not allowed to escape beyond an assertion. If there
are no more branches to try, (*THEN) causes a positive assertion to be false,
and a negative assertion to be true.
@@ -3859,6 +3870,6 @@
.rs
.sp
.nf
-Last updated: 13 July 2019
+Last updated: 28 July 2019
Copyright (c) 1997-2019 University of Cambridge.
.fi
Modified: code/trunk/testdata/testinput2
===================================================================
--- code/trunk/testdata/testinput2 2019-07-23 16:58:57 UTC (rev 1144)
+++ code/trunk/testdata/testinput2 2019-07-28 15:32:11 UTC (rev 1145)
@@ -5688,6 +5688,21 @@
/(*napla:abc|abd)/I
+/(*napla:a|(.)(*ACCEPT)zz)\1../
+ abcd
+
+/(*napla:a(*ACCEPT)zz|(.))\1../
+ abcd
+
+/(*napla:a|(*COMMIT)(.))\1\1/
+ aabc
+\= Expect no match
+ abbc
+
+/(*napla:a|(.))\1\1/
+ aabc
+ abbc
+
# ----
# Expect error (recursion => not fixed length)
Modified: code/trunk/testdata/testoutput2
===================================================================
--- code/trunk/testdata/testoutput2 2019-07-23 16:58:57 UTC (rev 1144)
+++ code/trunk/testdata/testoutput2 2019-07-28 15:32:11 UTC (rev 1145)
@@ -17185,6 +17185,32 @@
First code unit = 'a'
Subject length lower bound = 1
+/(*napla:a|(.)(*ACCEPT)zz)\1../
+ abcd
+ 0: abc
+ 1: a
+
+/(*napla:a(*ACCEPT)zz|(.))\1../
+ abcd
+ 0: bcd
+ 1: b
+
+/(*napla:a|(*COMMIT)(.))\1\1/
+ aabc
+ 0: aa
+ 1: a
+\= Expect no match
+ abbc
+No match
+
+/(*napla:a|(.))\1\1/
+ aabc
+ 0: aa
+ 1: a
+ abbc
+ 0: bb
+ 1: b
+
# ----
# Expect error (recursion => not fixed length)