diff options
author | Gurusamy Sarathy <gsar@engin.umich.edu> | 1997-04-12 16:48:41 -0400 |
---|---|---|
committer | Chip Salzenberg <chip@atlantic.net> | 1997-04-09 00:00:00 +0000 |
commit | a99df21cfa7a5a885ca7e0b0c7aca7e984889792 (patch) | |
tree | 6c835e22fa4ff74b117790681ddf4cf9bf6d6bf0 /pod/perlre.pod | |
parent | 103ff8e3fc700e65c46dc39d16ec66d203f75af9 (diff) | |
download | perl-a99df21cfa7a5a885ca7e0b0c7aca7e984889792.tar.gz |
Explain //g and \G issues
private-msgid: 199704122048.QAA25060@aatma.engin.umich.edu
Diffstat (limited to 'pod/perlre.pod')
-rw-r--r-- | pod/perlre.pod | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/pod/perlre.pod b/pod/perlre.pod index f881a3bcc7..ed9c5334b8 100644 --- a/pod/perlre.pod +++ b/pod/perlre.pod @@ -163,7 +163,7 @@ Perl defines the following zero-width assertions: \B Match a non-(word boundary) \A Match at only beginning of string \Z Match at only end of string (or before newline at the end) - \G Match only where previous m//g left off + \G Match only where previous m//g left off (works only with /g) A word boundary (C<\b>) is defined as a spot between two characters that has a C<\w> on one side of it and a C<\W> on the other side of it (in @@ -173,9 +173,10 @@ represents backspace rather than a word boundary.) The C<\A> and C<\Z> are just like "^" and "$" except that they won't match multiple times when the C</m> modifier is used, while "^" and "$" will match at every internal line boundary. To match the actual end of the string, not ignoring newline, -you can use C<\Z(?!\n)>. The C<\G> assertion can be used to mix global -matches (using C<m//g>) and non-global ones, as described in +you can use C<\Z(?!\n)>. The C<\G> assertion can be used to chain global +matches (using C<m//g>), as described in L<perlop/"Regexp Quote-Like Operators">. + It is also useful when writing C<lex>-like scanners, when you have several regexps which you want to match against consequent substrings of your string, see the previous reference. |