X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=pod%2Fperlre.pod;h=529c44adf16f28f8c6d9153975631fd5031906f8;hb=197afce1e759b5f0a1885a151064a83b27a7324e;hp=45e41e5f54d5dc65e0c3c8fd0376034087cd71ba;hpb=e2e6a0f1870d05ddb1ce18fd8556b71330dc694c;p=p5sagit%2Fp5-mst-13.2.git
diff --git a/pod/perlre.pod b/pod/perlre.pod
index 45e41e5..529c44a 100644
--- a/pod/perlre.pod
+++ b/pod/perlre.pod
@@ -5,7 +5,7 @@ perlre - Perl regular expressions
=head1 DESCRIPTION
-This page describes the syntax of regular expressions in Perl.
+This page describes the syntax of regular expressions in Perl.
If you haven't used regular expressions before, a quick-start
introduction is available in L, C
+
Backslashed metacharacters in Perl are alphanumeric, such as C<\b>,
C<\w>, C<\n>. Unlike some other regular expression languages, there
are no backslashed symbols that aren't alphanumeric. So anything
@@ -593,33 +677,42 @@ whitespace formatting, a simple C<#> will suffice. Note that Perl closes
the comment as soon as it sees a C<)>, so there is no way to put a literal
C<)> in the comment.
-=item C<(?imsx-imsx)>
+=item C<(?pimsx-imsx)>
X<(?)>
One or more embedded pattern-match modifiers, to be turned on (or
turned off, if preceded by C<->) for the remainder of the pattern or
the remainder of the enclosing pattern group (if any). This is
particularly useful for dynamic patterns, such as those read in from a
-configuration file, read in as an argument, are specified in a table
-somewhere, etc. Consider the case that some of which want to be case
-sensitive and some do not. The case insensitive ones need to include
-merely C<(?i)> at the front of the pattern. For example:
+configuration file, taken from an argument, or specified in a table
+somewhere. Consider the case where some patterns want to be case
+sensitive and some do not: The case insensitive ones merely need to
+include C<(?i)> at the front of the pattern. For example:
$pattern = "foobar";
- if ( /$pattern/i ) { }
+ if ( /$pattern/i ) { }
# more flexible:
$pattern = "(?i)foobar";
- if ( /$pattern/ ) { }
+ if ( /$pattern/ ) { }
These modifiers are restored at the end of the enclosing group. For example,
( (?i) blah ) \s+ \1
-will match a repeated (I modifier is special in that it can only be enabled,
+not disabled, and that its presence anywhere in a pattern has a global
+effect. Thus C<(?-p)> and C<(?-p:...)> are meaningless and will warn
+when executed under C),
-or indirectly with functions such as C), or indirectly with functions such as
+C),
or indirectly with functions such as C.
-=head2 Repeated patterns matching zero-length substring
+=head2 Repeated Patterns Matching a Zero-length Substring
B and C, C and C are substrings
-which can be matched by C than C, C