[Pcre-svn] [562] code/trunk/doc: Clarify documentation about…

Página Inicial
Delete this message
Autor: Subversion repository
Data:  
Para: pcre-svn
Assunto: [Pcre-svn] [562] code/trunk/doc: Clarify documentation about comments in patterns.
Revision: 562
          http://vcs.pcre.org/viewvc?view=rev&revision=562
Author:   ph10
Date:     2010-10-31 14:06:43 +0000 (Sun, 31 Oct 2010)


Log Message:
-----------
Clarify documentation about comments in patterns.

Modified Paths:
--------------
    code/trunk/doc/pcrecompat.3
    code/trunk/doc/pcrepattern.3


Modified: code/trunk/doc/pcrecompat.3
===================================================================
--- code/trunk/doc/pcrecompat.3    2010-10-30 18:37:47 UTC (rev 561)
+++ code/trunk/doc/pcrecompat.3    2010-10-31 14:06:43 UTC (rev 562)
@@ -6,7 +6,7 @@
 .sp
 This document describes the differences in the ways that PCRE and Perl handle
 regular expressions. The differences described here are with respect to Perl
-5.10/5.11.
+versions 5.10 and above.
 .P
 1. PCRE has only a subset of Perl's UTF-8 and Unicode support. Details of what
 it does have are given in the
@@ -103,7 +103,10 @@
 names map to capturing subpattern number 1. To avoid this confusing situation,
 an error is given at compile time.
 .P
-12. PCRE provides some extensions to the Perl regular expression facilities.
+12. Perl recognizes comments in some places that PCRE doesn't, for example, 
+between the ( and ? at the start of a subpattern.
+.P
+13. PCRE provides some extensions to the Perl regular expression facilities.
 Perl 5.10 includes new features that are not in earlier versions of Perl, some
 of which (such as named parentheses) have been in PCRE for some time. This list
 is with respect to Perl 5.10:
@@ -160,6 +163,6 @@
 .rs
 .sp
 .nf
-Last updated: 12 May 2010
+Last updated: 31 October 2010
 Copyright (c) 1997-2010 University of Cambridge.
 .fi


Modified: code/trunk/doc/pcrepattern.3
===================================================================
--- code/trunk/doc/pcrepattern.3    2010-10-30 18:37:47 UTC (rev 561)
+++ code/trunk/doc/pcrepattern.3    2010-10-31 14:06:43 UTC (rev 562)
@@ -2111,23 +2111,26 @@
 .SH COMMENTS
 .rs
 .sp
+There are two ways of including comments in patterns that are processed by 
+PCRE. In both cases, the start of the comment must not be in a character class,
+nor in the middle of any other sequence of related characters such as (?: or a
+subpattern name or number. The characters that make up a comment play no part
+in the pattern matching.
+.P
 The sequence (?# marks the start of a comment that continues up to the next
-closing parenthesis. Nested parentheses are not permitted. The characters
-that make up a comment play no part in the pattern matching at all.
-.P
-If the PCRE_EXTENDED option is set, an unescaped # character outside a
-character class introduces a comment that continues to immediately after the
-next newline character or character sequence in the pattern. Which characters 
-are interpreted as newlines is controlled by the options passed to 
-\fBpcre_compile()\fP or by a special sequence at the start of the pattern, as
-described in the section entitled
+closing parenthesis. Nested parentheses are not permitted. If the PCRE_EXTENDED
+option is set, an unescaped # character also introduces a comment, which in
+this case continues to immediately after the next newline character or
+character sequence in the pattern. Which characters are interpreted as newlines
+is controlled by the options passed to \fBpcre_compile()\fP or by a special
+sequence at the start of the pattern, as described in the section entitled
 .\" HTML <a href="#recursion">
 .\" </a>
 "Newline conventions"
 .\"
-above. Note that end of a comment is a literal newline sequence in the pattern; 
-escape sequences that happen to represent a newline do not terminate a comment. 
-For example, consider this pattern when PCRE_EXTENDED is set, and the default 
+above. Note that end of this type of comment is a literal newline sequence in
+the pattern; escape sequences that happen to represent a newline do not count.
+For example, consider this pattern when PCRE_EXTENDED is set, and the default
 newline convention is in force:
 .sp
   abc #comment \en still comment
@@ -2135,7 +2138,7 @@
 On encountering the # character, \fBpcre_compile()\fP skips along, looking for 
 a newline in the pattern. The sequence \en is still literal at this stage, so
 it does not terminate the comment. Only an actual character with the code value
-0x0a does so.
+0x0a (the default newline) does so.
 .
 .
 .\" HTML <a name="recursion"></a>
@@ -2711,6 +2714,6 @@
 .rs
 .sp
 .nf
-Last updated: 26 October 2010
+Last updated: 31 October 2010
 Copyright (c) 1997-2010 University of Cambridge.
 .fi