X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=pod%2Fperlre.pod;h=6d21a65f31e1aea4bea0f872cbb88db8aa220b16;hb=84287afe68eecc4342d7e27aac5d9df9d2412490;hp=1c7855c0411a68b1be1a704e16501ab0ba00b859;hpb=c07a80fdfe3926b5eb0585b674aa5d1f57b32ade;p=p5sagit%2Fp5-mst-13.2.git diff --git a/pod/perlre.pod b/pod/perlre.pod index 1c7855c..6d21a65 100644 --- a/pod/perlre.pod +++ b/pod/perlre.pod @@ -83,8 +83,8 @@ modifier to C<{1,}>, and the "?" modifier to C<{0,1}>. n and m are limited to integral values less than 65536. By default, a quantified subpattern is "greedy", that is, it will match as -many times as possible without causing the rest pattern not to match. The -standard quantifiers are all "greedy", in that they match as many +many times as possible without causing the rest of the pattern not to match. +The standard quantifiers are all "greedy", in that they match as many occurrences as possible (given a particular starting location) without causing the pattern to fail. If you want it to match the minimum number of times possible, follow the quantifier with a "?" after any of them. @@ -104,7 +104,6 @@ also work: \n newline \r return \f form feed - \v vertical tab, whatever that is \a alarm (bell) \e escape (think troff) \033 octal char (think of a PDP-11) @@ -151,13 +150,13 @@ you can use C<\Z(?!\n)>. When the bracketing construct C<( ... )> is used, \ matches the digit'th substring. Outside of the pattern, always use "$" instead of "\" -in front of the digit. (The \ notation can on rare occasion work +in front of the digit. (While the \ notation can on rare occasion work outside the current pattern, this should not be relied upon. See the -WARNING below.) The scope of $ (and C<$`>, C<$&>, and C<$')> +WARNING below.) The scope of $ (and C<$`>, C<$&>, and C<$'>) extends to the end of the enclosing BLOCK or eval string, or to the next successful pattern match, whichever comes first. If you want to use -parentheses to delimit subpattern (e.g. a set of alternatives) without -saving it as a subpattern, follow the ( with a ?. +parentheses to delimit a subpattern (e.g. a set of alternatives) without +saving it as a subpattern, follow the ( with a ?:. You may have as many parentheses as you wish. If you have more than 9 substrings, the variables $10, $11, ... refer to the @@ -331,7 +330,7 @@ That won't work at all, because C<.*> was greedy and gobbled up the whole string. As C<\d*> can match on an empty string the complete regular expression matched successfully. - Beginning is , number is <>. + Beginning is , number is <>. Here are some variants, most of which don't work: