From: Hugo van der Sanden Date: Fri, 29 Mar 2002 16:53:27 +0000 (+0000) Subject: Re: [DOC PATCH] Regex \G and POSIX restrictions X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=25cf8c221694f204b8dcdb15a864ea224c360401;p=p5sagit%2Fp5-mst-13.2.git Re: [DOC PATCH] Regex \G and POSIX restrictions Message-Id: <200203291653.g2TGrRp26588@crypt.compulink.co.uk> p4raw-id: //depot/perl@15608 --- diff --git a/pod/perlre.pod b/pod/perlre.pod index fef8ce3..f2ce3ff 100644 --- a/pod/perlre.pod +++ b/pod/perlre.pod @@ -349,8 +349,11 @@ It is also useful when writing C-like scanners, when you have several patterns that you want to match against consequent substrings of your string, see the previous reference. The actual location where C<\G> will match can also be influenced by using C as -an lvalue. Currently C<\G> only works when used at the -beginning of the pattern. See L. +an lvalue: see L. Currently C<\G> is only fully +supported when anchored to the start of the pattern; while it +is permitted to use it elsewhere, as in C, some +such uses (C, for example) currently cause problems, and +it is recommended that you avoid such usage for now. The bracketing construct C<( ... )> creates capture buffers. To refer to the digit'th buffer use \ within the diff --git a/pod/perlretut.pod b/pod/perlretut.pod index 4ea9ecc..f0b5d1d 100644 --- a/pod/perlretut.pod +++ b/pod/perlretut.pod @@ -1403,7 +1403,8 @@ off. C<\G> allows us to easily do context-sensitive matching: The combination of C and C<\G> allows us to process the string a bit at a time and use arbitrary Perl logic to decide what to do next. -Currently, the C<\G> anchor only works at the beginning of a pattern. +Currently, the C<\G> anchor is only fully supported when used to anchor +to the start of the pattern. C<\G> is also invaluable in processing fixed length records with regexps. Suppose we have a snippet of coding region DNA, encoded as