Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

The spaces are not redundant under *, pmichaud++

  • Loading branch information...
commit 0d42d6cbd32b7e4e77985b2c80534d44c80bffd6 1 parent 00da791
@TimToady TimToady authored
Showing with 9 additions and 1 deletion.
  1. +9 −1 S05-regex.pod
View
10 S05-regex.pod
@@ -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
@@ -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>
Please sign in to comment.
Something went wrong with that request. Please try again.