From: M. J. T. Guy Date: Tue, 7 Jul 1998 15:59:03 +0000 (+0100) Subject: applied patch to clarify m//g X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=7e86de3e163f833ae89c22b4ee3418ae793e26c5;p=p5sagit%2Fp5-mst-13.2.git applied patch to clarify m//g Message-Id: Subject: [PATCH] Re: m//g in perlop.pod p4raw-id: //depot/perl@1365 --- diff --git a/pod/perlop.pod b/pod/perlop.pod index cc657c1..96427b2 100644 --- a/pod/perlop.pod +++ b/pod/perlop.pod @@ -811,15 +811,13 @@ substrings matched by all the parentheses in the regular expression. If there are no parentheses, it returns a list of all the matched strings, as if there were parentheses around the whole pattern. -In scalar context, C iterates through the string, returning TRUE -each time it matches, and FALSE when it eventually runs out of matches. -(In other words, it remembers where it left off last time and restarts -the search at that point. You can actually find the current match -position of a string or set it using the pos() function; see -L.) A failed match normally resets the search position to -the beginning of the string, but you can avoid that by adding the C -modifier (e.g. C). Modifying the target string also resets the -search position. +In scalar context, each execution of C finds the next match, +returning TRUE if it matches, and FALSE if there is no further match. +The position after the last match can be read or set using the pos() +function; see L. A failed match normally resets the +search position to the beginning of the string, but you can avoid that +by adding the C modifier (e.g. C). Modifying the target +string also resets the search position. You can intermix C matches with C, where C<\G> is a zero-width assertion that matches the exact position where the previous