/[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 170 by ph10, Tue May 29 15:18:18 2007 UTC revision 171 by ph10, Mon Jun 4 14:28:58 2007 UTC
# Line 241  meanings Line 241  meanings
241  .rs  .rs
242  .sp  .sp
243  The sequence \eg followed by a positive or negative number, optionally enclosed  The sequence \eg followed by a positive or negative number, optionally enclosed
244  in braces, is an absolute or relative back reference. Back references are  in braces, is an absolute or relative back reference. A named back reference
245  discussed  can be coded as \eg{name}. Back references are discussed
246  .\" HTML <a href="#backreferences">  .\" HTML <a href="#backreferences">
247  .\" </a>  .\" </a>
248  later,  later,
# Line 1325  back reference, the case of letters is r Line 1325  back reference, the case of letters is r
1325  matches "rah rah" and "RAH RAH", but not "RAH rah", even though the original  matches "rah rah" and "RAH RAH", but not "RAH rah", even though the original
1326  capturing subpattern is matched caselessly.  capturing subpattern is matched caselessly.
1327  .P  .P
1328  Back references to named subpatterns use the Perl syntax \ek<name> or \ek'name'  There are several different ways of writing back references to named
1329  or the Python syntax (?P=name). We could rewrite the above example in either of  subpatterns. The .NET syntax \ek{name} and the Perl syntax \ek<name> or
1330    \ek'name' are supported, as is the Python syntax (?P=name). Perl 5.10's unified
1331    back reference syntax, in which \eg can be used for both numeric and named
1332    references, is also supported. We could rewrite the above example in any of
1333  the following ways:  the following ways:
1334  .sp  .sp
1335    (?<p1>(?i)rah)\es+\ek<p1>    (?<p1>(?i)rah)\es+\ek<p1>
1336      (?'p1'(?i)rah)\es+\ek{p1}
1337    (?P<p1>(?i)rah)\es+(?P=p1)    (?P<p1>(?i)rah)\es+(?P=p1)
1338      (?<p1>(?i)rah)\es+\eg{p1}
1339  .sp  .sp
1340  A subpattern that is referenced by name may appear in the pattern before or  A subpattern that is referenced by name may appear in the pattern before or
1341  after the reference.  after the reference.

Legend:
Removed from v.170  
changed lines
  Added in v.171

webmaster@exim.org
ViewVC Help
Powered by ViewVC 1.1.12