/[pcre]/code/trunk/doc/pcrepattern.3
ViewVC logotype

Diff of /code/trunk/doc/pcrepattern.3

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 557 by ph10, Tue Oct 26 15:26:12 2010 UTC revision 562 by ph10, Sun Oct 31 14:06:43 2010 UTC
# Line 2111  dd-aaa-dd or dd-dd-dd, where aaa are let Line 2111  dd-aaa-dd or dd-dd-dd, where aaa are let
2111  .SH COMMENTS  .SH COMMENTS
2112  .rs  .rs
2113  .sp  .sp
2114  The sequence (?# marks the start of a comment that continues up to the next  There are two ways of including comments in patterns that are processed by
2115  closing parenthesis. Nested parentheses are not permitted. The characters  PCRE. In both cases, the start of the comment must not be in a character class,
2116  that make up a comment play no part in the pattern matching at all.  nor in the middle of any other sequence of related characters such as (?: or a
2117    subpattern name or number. The characters that make up a comment play no part
2118    in the pattern matching.
2119  .P  .P
2120  If the PCRE_EXTENDED option is set, an unescaped # character outside a  The sequence (?# marks the start of a comment that continues up to the next
2121  character class introduces a comment that continues to immediately after the  closing parenthesis. Nested parentheses are not permitted. If the PCRE_EXTENDED
2122  next newline character or character sequence in the pattern. Which characters  option is set, an unescaped # character also introduces a comment, which in
2123  are interpreted as newlines is controlled by the options passed to  this case continues to immediately after the next newline character or
2124  \fBpcre_compile()\fP or by a special sequence at the start of the pattern, as  character sequence in the pattern. Which characters are interpreted as newlines
2125  described in the section entitled  is controlled by the options passed to \fBpcre_compile()\fP or by a special
2126    sequence at the start of the pattern, as described in the section entitled
2127  .\" HTML <a href="#recursion">  .\" HTML <a href="#recursion">
2128  .\" </a>  .\" </a>
2129  "Newline conventions"  "Newline conventions"
2130  .\"  .\"
2131  above. Note that end of a comment is a literal newline sequence in the pattern;  above. Note that end of this type of comment is a literal newline sequence in
2132  escape sequences that happen to represent a newline do not terminate a comment.  the pattern; escape sequences that happen to represent a newline do not count.
2133  For example, consider this pattern when PCRE_EXTENDED is set, and the default  For example, consider this pattern when PCRE_EXTENDED is set, and the default
2134  newline convention is in force:  newline convention is in force:
2135  .sp  .sp
2136    abc #comment \en still comment    abc #comment \en still comment
# Line 2135  newline convention is in force: Line 2138  newline convention is in force:
2138  On encountering the # character, \fBpcre_compile()\fP skips along, looking for  On encountering the # character, \fBpcre_compile()\fP skips along, looking for
2139  a newline in the pattern. The sequence \en is still literal at this stage, so  a newline in the pattern. The sequence \en is still literal at this stage, so
2140  it does not terminate the comment. Only an actual character with the code value  it does not terminate the comment. Only an actual character with the code value
2141  0x0a does so.  0x0a (the default newline) does so.
2142  .  .
2143  .  .
2144  .\" HTML <a name="recursion"></a>  .\" HTML <a name="recursion"></a>
# Line 2711  Cambridge CB2 3QH, England. Line 2714  Cambridge CB2 3QH, England.
2714  .rs  .rs
2715  .sp  .sp
2716  .nf  .nf
2717  Last updated: 26 October 2010  Last updated: 31 October 2010
2718  Copyright (c) 1997-2010 University of Cambridge.  Copyright (c) 1997-2010 University of Cambridge.
2719  .fi  .fi

Legend:
Removed from v.557  
changed lines
  Added in v.562

  ViewVC Help
Powered by ViewVC 1.1.5