[Pcre-svn] [975] code/trunk/doc: Documentation update regard…

Top Page
Delete this message
Author: Subversion repository
Date:  
To: pcre-svn
Subject: [Pcre-svn] [975] code/trunk/doc: Documentation update regarding \Q handling.
Revision: 975
          http://www.exim.org/viewvc/pcre2?view=rev&revision=975
Author:   ph10
Date:     2018-07-28 16:08:22 +0100 (Sat, 28 Jul 2018)
Log Message:
-----------
Documentation update regarding \Q handling.


Modified Paths:
--------------
    code/trunk/doc/pcre2compat.3
    code/trunk/doc/pcre2pattern.3


Modified: code/trunk/doc/pcre2compat.3
===================================================================
--- code/trunk/doc/pcre2compat.3    2018-07-27 16:55:52 UTC (rev 974)
+++ code/trunk/doc/pcre2compat.3    2018-07-28 15:08:22 UTC (rev 975)
@@ -1,4 +1,4 @@
-.TH PCRE2COMPAT 3 "27 July 2018" "PCRE2 10.32"
+.TH PCRE2COMPAT 3 "28 July 2018" "PCRE2 10.32"
 .SH NAME
 PCRE2 - Perl-compatible regular expressions (revised API)
 .SH "DIFFERENCES BETWEEN PCRE2 AND PERL"
@@ -29,12 +29,13 @@
 false).
 .P
 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.
+\eU, and \eN when followed by a character name. \eN on its own, matching a
+non-newline character, and \eN{U+dd..}, matching a Unicode code point, are
+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
 built with Unicode support (the default). The properties that can be tested
@@ -45,13 +46,16 @@
 internal representation of Unicode characters, there is no need to implement
 the somewhat messy concept of surrogates."
 .P
-6. PCRE2 does support the \eQ...\eE escape for quoting substrings. Characters
-in between are treated as literals. This is slightly different from Perl in
-that $ and @ are also handled as literals inside the quotes. In Perl, they
-cause variable interpolation (but of course PCRE2 does not have variables).
-Note the following examples:
+6. PCRE2 supports the \eQ...\eE escape for quoting substrings. Characters
+in between are treated as literals. However, this is slightly different from
+Perl in that $ and @ are also handled as literals inside the quotes. In Perl,
+they cause variable interpolation (but of course PCRE2 does not have
+variables). Also, Perl does "double-quotish backslash interpolation" on any
+backslashes between \eQ and \eE which, its documentation says, "may lead to
+confusing results". PCRE2 treats a backslash between \eQ and \eE just like any
+other character. Note the following examples:
 .sp
-    Pattern            PCRE2 matches      Perl matches
+    Pattern            PCRE2 matches     Perl matches
 .sp
 .\" JOIN
     \eQabc$xyz\eE        abc$xyz           abc followed by the
@@ -58,6 +62,8 @@
                                            contents of $xyz
     \eQabc\e$xyz\eE       abc\e$xyz          abc\e$xyz
     \eQabc\eE\e$\eQxyz\eE   abc$xyz           abc$xyz
+    \eQA\eB\eE            A\eB               A\eB
+    \eQ\e\eE              \e                 \e\eE
 .sp
 The \eQ...\eE sequence is recognized both inside and outside character classes.
 .P
@@ -194,6 +200,6 @@
 .rs
 .sp
 .nf
-Last updated: 27 July 2018
+Last updated: 28 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:55:52 UTC (rev 974)
+++ code/trunk/doc/pcre2pattern.3    2018-07-28 15:08:22 UTC (rev 975)
@@ -1,4 +1,4 @@
-.TH PCRE2PATTERN 3 "27 July 2018" "PCRE2 10.32"
+.TH PCRE2PATTERN 3 "28 July 2018" "PCRE2 10.32"
 .SH NAME
 PCRE2 - Perl-compatible regular expressions (revised API)
 .SH "PCRE2 REGULAR EXPRESSION DETAILS"
@@ -331,7 +331,10 @@
 If you want to remove the special meaning from a sequence of characters, you
 can do so by putting them between \eQ and \eE. This is different from Perl in
 that $ and @ are handled as literals in \eQ...\eE sequences in PCRE2, whereas
-in Perl, $ and @ cause variable interpolation. Note the following examples:
+in Perl, $ and @ cause variable interpolation. Also, Perl does "double-quotish 
+backslash interpolation" on any backslashes between \eQ and \eE which, its
+documentation says, "may lead to confusing results". PCRE2 treats a backslash
+between \eQ and \eE just like any other character. Note the following examples:
 .sp
   Pattern            PCRE2 matches   Perl matches
 .sp
@@ -340,6 +343,8 @@
                                       contents of $xyz
   \eQabc\e$xyz\eE       abc\e$xyz       abc\e$xyz
   \eQabc\eE\e$\eQxyz\eE   abc$xyz        abc$xyz
+  \eQA\eB\eE            A\eB            A\eB
+  \eQ\e\eE              \e              \e\eE
 .sp
 The \eQ...\eE sequence is recognized both inside and outside character classes.
 An isolated \eE that is not preceded by \eQ is ignored. If \eQ is not followed
@@ -3604,6 +3609,6 @@
 .rs
 .sp
 .nf
-Last updated: 27 July 2018
+Last updated: 28 July 2018
 Copyright (c) 1997-2018 University of Cambridge.
 .fi