From 04838ceaee8e1344b7b5599b60f8b5fc6a1f385f Mon Sep 17 00:00:00 2001 From: Rafael Garcia-Suarez Date: Fri, 13 Oct 2006 09:15:43 +0000 Subject: [PATCH] Fix nit in possessive quantifier descriptions. Add some =head3 headings. p4raw-id: //depot/perl@29006 --- pod/perlre.pod | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/pod/perlre.pod b/pod/perlre.pod index c89d29f..d78db38 100644 --- a/pod/perlre.pod +++ b/pod/perlre.pod @@ -82,6 +82,8 @@ X =head2 Regular Expressions +=head3 Metacharacters + The patterns used in Perl pattern matching derive from supplied in the Version 8 regex routines. (The routines are derived (distantly) from Henry Spencer's freely redistributable reimplementation @@ -119,6 +121,8 @@ newline unless you use the C modifier, which in effect tells Perl to pretend the string is a single line--even if it isn't. X<.> X +=head3 Quantifiers + The following standard quantifiers are recognized: X X X<*> X<+> X X<{n}> X<{n,}> X<{n,m}> @@ -160,11 +164,11 @@ sometimes undesirable. Thus Perl provides the "possesive" quantifier form as well. *+ Match 0 or more times and give nothing back - +? Match 1 or more times and give nothing back + ++ Match 1 or more times and give nothing back ?+ Match 0 or 1 time and give nothing back {n}+ Match exactly n times and give nothing back (redundant) - {n,}? Match at least n times and give nothing back - {n,m}? Match at least n but not more than m times and give nothing back + {n,}+ Match at least n times and give nothing back + {n,m}+ Match at least n but not more than m times and give nothing back For instance, @@ -185,6 +189,8 @@ instance the above example could also be written as follows: /"(?>(?:(?>[^"\\]+)|\\.)*)"/ +=head3 Escape sequences + Because patterns are processed as double quoted strings, the following also work: X<\t> X<\n> X<\r> X<\f> X<\a> X<\l> X<\u> X<\L> X<\U> X<\E> X<\Q> @@ -217,6 +223,8 @@ An unescaped C<$> or C<@> interpolates the corresponding variable, while escaping will cause the literal string C<\$> to be matched. You'll need to write something like C. +=head3 Character classes + In addition, Perl defines the following: X X<\w> X<\W> X<\s> X<\S> X<\d> X<\D> X<\X> X<\p> X<\P> X<\C> @@ -397,6 +405,8 @@ only supported within a character class. The POSIX character classes [.cc.] and [=cc=] are recognized but B supported and trying to use them will cause an error. +=head3 Assertions + Perl defines the following zero-width assertions: X X X X @@ -437,6 +447,8 @@ such uses (C, for example) currently cause problems, and it is recommended that you avoid such usage for now. X<\G> +=head3 Capture buffers + The bracketing construct C<( ... )> creates capture buffers. To refer to the digit'th buffer use \ within the match. Outside the match use "$" instead of "\". (The -- 2.7.4