/[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 456 by ph10, Fri Oct 2 08:53:31 2009 UTC revision 457 by ph10, Sat Oct 3 16:24:08 2009 UTC
# Line 1175  pattern matches "abcabc" or "defabc": Line 1175  pattern matches "abcabc" or "defabc":
1175  .sp  .sp
1176    /(?|(abc)|(def))(?1)/    /(?|(abc)|(def))(?1)/
1177  .sp  .sp
 .P  
1178  An alternative approach to using the "branch reset" feature is to use  An alternative approach to using the "branch reset" feature is to use
1179  duplicate named subpatterns, as described in the next section.  duplicate named subpatterns, as described in the next section.
1180  .  .
# Line 1216  extracting the name-to-number translatio Line 1215  extracting the name-to-number translatio
1215  is also a convenience function for extracting a captured substring by name.  is also a convenience function for extracting a captured substring by name.
1216  .P  .P
1217  By default, a name must be unique within a pattern, but it is possible to relax  By default, a name must be unique within a pattern, but it is possible to relax
1218  this constraint by setting the PCRE_DUPNAMES option at compile time. This can  this constraint by setting the PCRE_DUPNAMES option at compile time. (Duplicate
1219  be useful for patterns where only one instance of the named parentheses can  names are also always permitted for subpatterns with the same number, set up as
1220  match. Suppose you want to match the name of a weekday, either as a 3-letter  described in the previous section.) Duplicate names can be useful for patterns
1221  abbreviation or as the full name, and in both cases you want to extract the  where only one instance of the named parentheses can match. Suppose you want to
1222  abbreviation. This pattern (ignoring the line breaks) does the job:  match the name of a weekday, either as a 3-letter abbreviation or as the full
1223    name, and in both cases you want to extract the abbreviation. This pattern
1224    (ignoring the line breaks) does the job:
1225  .sp  .sp
1226    (?<DN>Mon|Fri|Sun)(?:day)?|    (?<DN>Mon|Fri|Sun)(?:day)?|
1227    (?<DN>Tue)(?:sday)?|    (?<DN>Tue)(?:sday)?|
# Line 1244  details of the interfaces for handling n Line 1245  details of the interfaces for handling n
1245  documentation.  documentation.
1246  .P  .P
1247  \fBWarning:\fP You cannot use different names to distinguish between two  \fBWarning:\fP You cannot use different names to distinguish between two
1248  subpatterns with the same number (see the previous section) because PCRE uses  subpatterns with the same number because PCRE uses only the numbers when
1249  only the numbers when matching.  matching. For this reason, an error is given at compile time if different names
1250    are given to subpatterns with the same number. However, you can give the same
1251    name to subpatterns with the same number, even when PCRE_DUPNAMES is not set.
1252  .  .
1253  .  .
1254  .SH REPETITION  .SH REPETITION
# Line 2388  Cambridge CB2 3QH, England. Line 2391  Cambridge CB2 3QH, England.
2391  .rs  .rs
2392  .sp  .sp
2393  .nf  .nf
2394  Last updated: 30 September 2009  Last updated: 03 October 2009
2395  Copyright (c) 1997-2009 University of Cambridge.  Copyright (c) 1997-2009 University of Cambridge.
2396  .fi  .fi

Legend:
Removed from v.456  
changed lines
  Added in v.457

webmaster@exim.org
ViewVC Help
Powered by ViewVC 1.1.12