[PATCH] [pod] improve documentation for (?(cond)yes|no)
authorMoritz Lenz <moritz@casella.verplant.org>
Sat, 19 Mar 2011 10:44:23 +0000 (10:44 +0000)
committerChris 'BinGOs' Williams <chris@bingosnet.co.uk>
Sat, 19 Mar 2011 10:44:23 +0000 (10:44 +0000)
perlre:    Include a high-level description of what it does, and what a missing
           pattern means
perlreref: Include missing look-around cases

Signed-off-by: Chris 'BinGOs' Williams <chris@bingosnet.co.uk>
pod/perlre.pod
pod/perlreref.pod

index bb92720..387c820 100644 (file)
@@ -1199,7 +1199,11 @@ X<(?()>
 
 =item C<(?(condition)yes-pattern)>
 
-Conditional expression.  C<(condition)> should be either an integer in
+Conditional expression. Matches C<yes-pattern> if C<condition> yields
+a true value, matches C<no-pattern> otherwise. A missing pattern always
+matches.
+
+C<(condition)> should be either an integer in
 parentheses (which is valid if the corresponding pair of parentheses
 matched), a look-ahead/look-behind/evaluate zero-width assertion, a
 name in angle brackets or single quotes (which is valid if a group
index 54b619f..efae00c 100644 (file)
@@ -243,6 +243,10 @@ There is no quantifier C<{,n}>. That's interpreted as a literal string.
    (?P>name)         Recurse into a named subpattern (python syntax)
    (?(cond)yes|no)
    (?(cond)yes)      Conditional expression, where "cond" can be:
+                     (?=pat)   look-ahead
+                     (?!pat)   negative look-ahead
+                     (?<=pat)  look-behind
+                     (?<!pat)  negative look-behind
                      (N)       subpattern N has matched something
                      (<name>)  named subpattern has matched something
                      ('name')  named subpattern has matched something