X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=pod%2Fperlrequick.pod;h=a31adab5eb8f4a7372c7dd70960c7b0e4d134c29;hb=f7e7bc433bd27536177abe998df51111ab543b7a;hp=3e29a4ac83103c46a370176f546b7a5573060882;hpb=551e1d922a333f90a45a26904eb4d9882f7bd5d4;p=p5sagit%2Fp5-mst-13.2.git diff --git a/pod/perlrequick.pod b/pod/perlrequick.pod index 3e29a4a..a31adab 100644 --- a/pod/perlrequick.pod +++ b/pod/perlrequick.pod @@ -219,11 +219,11 @@ boundary. =head2 Matching this or that -We can match match different character strings with the B +We can match different character strings with the B metacharacter C<'|'>. To match C or C, we form the regex C. As before, perl will try to match the regex at the earliest possible point in the string. At each character position, -perl will first try to match the the first alternative, C. If +perl will first try to match the first alternative, C. If C doesn't match, perl will then try the next alternative, C. If C doesn't match either, then the match fails and perl moves to the next position in the string. Some examples: @@ -238,7 +238,7 @@ C is able to match earlier in the string. "cats" =~ /cats|cat|ca|c/; # matches "cats" At a given character position, the first alternative that allows the -regex match to succeed wil be the one that matches. Here, all the +regex match to succeed will be the one that matches. Here, all the alternatives match at the first string position, so th first matches. =head2 Grouping things and hierarchical matching @@ -304,18 +304,30 @@ have the following meanings: =over 4 -=item * C = match 'a' 1 or 0 times +=item * + +C = match 'a' 1 or 0 times + +=item * + +C = match 'a' 0 or more times, i.e., any number of times + +=item * -=item * C = match 'a' 0 or more times, i.e., any number of times +C = match 'a' 1 or more times, i.e., at least once -=item * C = match 'a' 1 or more times, i.e., at least once +=item * -=item * C = match at least C times, but not more than C +C = match at least C times, but not more than C times. -=item * C = match at least C or more times +=item * + +C = match at least C or more times + +=item * -=item * C = match exactly C times +C = match exactly C times =back