Revision: 974
http://www.exim.org/viewvc/pcre2?view=rev&revision=974
Author: ph10
Date: 2018-07-27 17:55:52 +0100 (Fri, 27 Jul 2018)
Log Message:
-----------
Give specific error for \F as for \L, \U etc.
Modified Paths:
--------------
code/trunk/doc/pcre2compat.3
code/trunk/doc/pcre2pattern.3
code/trunk/src/pcre2_compile.c
code/trunk/src/pcre2_error.c
code/trunk/testdata/testinput2
code/trunk/testdata/testoutput2
code/trunk/testdata/testoutput5
Modified: code/trunk/doc/pcre2compat.3
===================================================================
--- code/trunk/doc/pcre2compat.3 2018-07-27 16:42:25 UTC (rev 973)
+++ code/trunk/doc/pcre2compat.3 2018-07-27 16:55:52 UTC (rev 974)
@@ -1,4 +1,4 @@
-.TH PCRE2COMPAT 3 "18 April 2017" "PCRE2 10.30"
+.TH PCRE2COMPAT 3 "27 July 2018" "PCRE2 10.32"
.SH NAME
PCRE2 - Perl-compatible regular expressions (revised API)
.SH "DIFFERENCES BETWEEN PCRE2 AND PERL"
@@ -28,12 +28,12 @@
assertion is a condition that has a matching branch (that is, the condition is
false).
.P
-4. The following Perl escape sequences are not supported: \el, \eu, \eL,
-\eU, and \eN when followed by a character name or Unicode value. (\eN on its
-own, matching a non-newline character, is supported.) In fact these are
-implemented by Perl's general string-handling and are not part of its pattern
-matching engine. If any of these are encountered by PCRE2, an error is
-generated by default. However, if the PCRE2_ALT_BSUX option is set,
+4. The following Perl escape sequences are not supported: \eF, \el, \eL, \eu,
+\eU, and \eN when followed by a character name. (\eN on its own, matching a
+non-newline character, is supported.) The escapes that modify the case of
+following letters are implemented by Perl's general string-handling and are not
+part of its pattern matching engine. If any of these are encountered by PCRE2,
+an error is generated by default. However, if the PCRE2_ALT_BSUX option is set,
\eU and \eu are interpreted as ECMAScript interprets them.
.P
5. The Perl escape sequences \ep, \eP, and \eX are supported only if PCRE2 is
@@ -194,6 +194,6 @@
.rs
.sp
.nf
-Last updated: 18 April 2017
-Copyright (c) 1997-2017 University of Cambridge.
+Last updated: 27 July 2018
+Copyright (c) 1997-2018 University of Cambridge.
.fi
Modified: code/trunk/doc/pcre2pattern.3
===================================================================
--- code/trunk/doc/pcre2pattern.3 2018-07-27 16:42:25 UTC (rev 973)
+++ code/trunk/doc/pcre2pattern.3 2018-07-27 16:55:52 UTC (rev 974)
@@ -523,7 +523,7 @@
.SS "Unsupported escape sequences"
.rs
.sp
-In Perl, the sequences \el, \eL, \eu, and \eU are recognized by its string
+In Perl, the sequences \eF, \el, \eL, \eu, and \eU are recognized by its string
handler and used to modify the case of following characters. By default, PCRE2
does not support these escape sequences. However, if the PCRE2_ALT_BSUX option
is set, \eU matches a "U" character, and \eu can be used to define a character
Modified: code/trunk/src/pcre2_compile.c
===================================================================
--- code/trunk/src/pcre2_compile.c 2018-07-27 16:42:25 UTC (rev 973)
+++ code/trunk/src/pcre2_compile.c 2018-07-27 16:55:52 UTC (rev 974)
@@ -1504,6 +1504,7 @@
/* A number of Perl escapes are not handled by PCRE. We give an explicit
error. */
+ case CHAR_F:
case CHAR_l:
case CHAR_L:
*errorcodeptr = ERR37;
Modified: code/trunk/src/pcre2_error.c
===================================================================
--- code/trunk/src/pcre2_error.c 2018-07-27 16:42:25 UTC (rev 973)
+++ code/trunk/src/pcre2_error.c 2018-07-27 16:55:52 UTC (rev 974)
@@ -107,7 +107,7 @@
/* 35 */
"lookbehind is too complicated\0"
"\\C is not allowed in a lookbehind assertion in UTF-" XSTRING(PCRE2_CODE_UNIT_WIDTH) " mode\0"
- "PCRE does not support \\L, \\l, \\N{name}, \\U, or \\u\0"
+ "PCRE2 does not support \\F, \\L, \\l, \\N{name}, \\U, or \\u\0"
"number after (?C is greater than 255\0"
"closing parenthesis for (?C expected\0"
/* 40 */
Modified: code/trunk/testdata/testinput2
===================================================================
--- code/trunk/testdata/testinput2 2018-07-27 16:42:25 UTC (rev 973)
+++ code/trunk/testdata/testinput2 2018-07-27 16:55:52 UTC (rev 974)
@@ -910,6 +910,8 @@
/[:x:]/I
+/\F/I
+
/\l/I
/\L/I
Modified: code/trunk/testdata/testoutput2
===================================================================
--- code/trunk/testdata/testoutput2 2018-07-27 16:42:25 UTC (rev 973)
+++ code/trunk/testdata/testoutput2 2018-07-27 16:55:52 UTC (rev 974)
@@ -3244,20 +3244,23 @@
/[:x:]/I
Failed: error 112 at offset 0: POSIX named classes are supported only within a class
+/\F/I
+Failed: error 137 at offset 2: PCRE2 does not support \F, \L, \l, \N{name}, \U, or \u
+
/\l/I
-Failed: error 137 at offset 2: PCRE does not support \L, \l, \N{name}, \U, or \u
+Failed: error 137 at offset 2: PCRE2 does not support \F, \L, \l, \N{name}, \U, or \u
/\L/I
-Failed: error 137 at offset 2: PCRE does not support \L, \l, \N{name}, \U, or \u
+Failed: error 137 at offset 2: PCRE2 does not support \F, \L, \l, \N{name}, \U, or \u
/\N{name}/I
-Failed: error 137 at offset 2: PCRE does not support \L, \l, \N{name}, \U, or \u
+Failed: error 137 at offset 2: PCRE2 does not support \F, \L, \l, \N{name}, \U, or \u
/\u/I
-Failed: error 137 at offset 2: PCRE does not support \L, \l, \N{name}, \U, or \u
+Failed: error 137 at offset 2: PCRE2 does not support \F, \L, \l, \N{name}, \U, or \u
/\U/I
-Failed: error 137 at offset 2: PCRE does not support \L, \l, \N{name}, \U, or \u
+Failed: error 137 at offset 2: PCRE2 does not support \F, \L, \l, \N{name}, \U, or \u
/a{1,3}b/ungreedy
ab
Modified: code/trunk/testdata/testoutput5
===================================================================
--- code/trunk/testdata/testoutput5 2018-07-27 16:42:25 UTC (rev 973)
+++ code/trunk/testdata/testoutput5 2018-07-27 16:55:52 UTC (rev 974)
@@ -4756,6 +4756,6 @@
Failed: error 178 at offset 5: digits missing in \x{} or \o{} or \N{U+}
/\N{U}/
-Failed: error 137 at offset 2: PCRE does not support \L, \l, \N{name}, \U, or \u
+Failed: error 137 at offset 2: PCRE2 does not support \F, \L, \l, \N{name}, \U, or \u
# End of testinput5