Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
The spaces are not redundant under *, pmichaud++
  • Loading branch information
TimToady committed Aug 1, 2012
1 parent 00da791 commit 0d42d6c
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion S05-regex.pod
Expand Up @@ -1135,7 +1135,8 @@ it ignores whitespace #1 and #4, and rewrites the rest to:
/ [ <element> <.ws> ]+ % [ ',' <.ws> ] <.ws> /
#2 #5 #3

Since #3 is redundant with #2, it suffices to supply either #2 or #3:
Since #3 is redundant with #2 (because C<+> requires an element),
it suffices to supply either #2 or #3:

ms/ <element>+ % ',' / # ws after comma and at end
ms/ <element> +% ',' / # ws after comma and any element
Expand Down Expand Up @@ -1164,6 +1165,13 @@ excludes all significant whitespace like this:

/ <element>[','<element>]* /

Note that with a C<*> instead of a C<+>, space #3 would not be
redundant with #2, since if 0 elements are matched, the space
associated with it (#2) is not matched. In that case it makes sense
to put space on both sides of the C<*>:

ms/ <element> * % ',' /

=item *

C<< <...> >> are now extensible metasyntax delimiters or I<assertions>
Expand Down

0 comments on commit 0d42d6c

Please sign in to comment.