Skip to content
This repository
Browse code

The spaces are not redundant under *, pmichaud++

  • Loading branch information...
commit 0d42d6cbd32b7e4e77985b2c80534d44c80bffd6 1 parent 00da791
Larry Wall authored August 01, 2012

Showing 1 changed file with 9 additions and 1 deletion. Show diff stats Hide diff stats

  1. 10  S05-regex.pod
10  S05-regex.pod
Source Rendered
@@ -1135,7 +1135,8 @@ it ignores whitespace #1 and #4, and rewrites the rest to:
1135 1135
     / [ <element> <.ws> ]+ % [ ',' <.ws> ] <.ws> /
1136 1136
                     #2               #5      #3
1137 1137
 
1138  
-Since #3 is redundant with #2, it suffices to supply either #2 or #3:
  1138
+Since #3 is redundant with #2 (because C<+> requires an element),
  1139
+it suffices to supply either #2 or #3:
1139 1140
 
1140 1141
     ms/ <element>+ % ',' /    # ws after comma and at end
1141 1142
     ms/ <element> +% ',' /    # ws after comma and any element
@@ -1164,6 +1165,13 @@ excludes all significant whitespace like this:
1164 1165
 
1165 1166
     / <element>[','<element>]* /
1166 1167
 
  1168
+Note that with a C<*> instead of a C<+>, space #3 would not be
  1169
+redundant with #2, since if 0 elements are matched, the space
  1170
+associated with it (#2) is not matched.  In that case it makes sense
  1171
+to put space on both sides of the C<*>:
  1172
+
  1173
+    ms/ <element> * % ',' /
  1174
+
1167 1175
 =item *
1168 1176
 
1169 1177
 C<< <...> >> are now extensible metasyntax delimiters or I<assertions>

0 notes on commit 0d42d6c

Please sign in to comment.
Something went wrong with that request. Please try again.