Change 33852 by [EMAIL PROTECTED] on 2008/05/18 08:56:12 New separations for the pattern match operator documentation, suggested by David Nicol: Subject: It's wafer thin! From: "David Nicol" <[EMAIL PROTECTED]> Date: Fri, 9 May 2008 18:14:29 +0000 Message-ID: <[EMAIL PROTECTED]>
Affected files ... ... //depot/perl/pod/perlop.pod#171 edit Differences ... ==== //depot/perl/pod/perlop.pod#171 (text) ==== Index: perl/pod/perlop.pod --- perl/pod/perlop.pod#170~33328~ 2008-02-18 03:10:13.000000000 -0800 +++ perl/pod/perlop.pod 2008-05-18 01:56:12.000000000 -0700 @@ -1151,6 +1151,8 @@ that you won't change the variables in the pattern. If you change them, Perl won't even notice. See also L<"qr/STRING/msixpo">. +=item The empty pattern // + If the PATTERN evaluates to the empty string, the last I<successfully> matched regular expression is used instead. In this case, only the C<g> and C<c> flags on the empty pattern is honoured - @@ -1167,6 +1169,8 @@ use parentheses or spaces to disambiguate, or even prefix the empty regex with an C<m> (so C<//> becomes C<m//>). +=item Matching in list context + If the C</g> option is not used, C<m//> in list context returns a list consisting of the subexpressions matched by the parentheses in the pattern, i.e., (C<$1>, C<$2>, C<$3>...). (Note that here C<$1> etc. are @@ -1213,6 +1217,8 @@ by adding the C</c> modifier (e.g. C<m//gc>). Modifying the target string also resets the search position. +=item \G assertion + You can intermix C<m//g> matches with C<m/\G.../g>, where C<\G> is a zero-width assertion that matches the exact position where the previous C<m//g>, if any, left off. Without the C</g> modifier, the C<\G> assertion End of Patch.