X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=pod%2Fperlfaq6.pod;h=4ab4d4cc982742f7e5f323ddde1d2b11dcb04f91;hb=22d4bb9ccb8701e68f9243547d7e3a3c55f70908;hp=29136abd967ebac67009088e2901a1d9e3f30d7e;hpb=4b19af017623bfa3bb72bb164598a517f586e0d3;p=p5sagit%2Fp5-mst-13.2.git diff --git a/pod/perlfaq6.pod b/pod/perlfaq6.pod index 29136ab..4ab4d4c 100644 --- a/pod/perlfaq6.pod +++ b/pod/perlfaq6.pod @@ -527,11 +527,16 @@ variable is no longer "expensive" the way the other two are. =head2 What good is C<\G> in a regular expression? -The notation C<\G> is used in a match or substitution in conjunction the -C modifier (and ignored if there's no C) to anchor the regular -expression to the point just past where the last match occurred, i.e. the -pos() point. A failed match resets the position of C<\G> unless the -C modifier is in effect. +The notation C<\G> is used in a match or substitution in conjunction with +the C modifier to anchor the regular expression to the point just past +where the last match occurred, i.e. the pos() point. A failed match resets +the position of C<\G> unless the C modifier is in effect. C<\G> can be +used in a match without the C modifier; it acts the same (i.e. still +anchors at the pos() point) but of course only matches once and does not +update pos(), as non-C expressions never do. C<\G> in an expression +applied to a target string that has never been matched against a C +expression before or has had its pos() reset is functionally equivalent to +C<\A>, which matches at the beginning of the string. For example, suppose you had a line of text quoted in standard mail and Usenet notation, (that is, with leading C<< > >> characters), and