@@ -1170,7 +1170,8 @@ Note that neither the colon C<:> nor balancing delimiters such as C<{}> or
1170
1170
C < () > can be substitution delimiters. Colons clash with adverbs such as
1171
1171
C < s:i/Foo/bar/ > and the other delimiters are used for other purposes.
1172
1172
1173
- If you use balancing brackets, the substitution works like this instead:
1173
+ If you use balancing brackets/braces/parentheses, the substitution works like
1174
+ this instead:
1174
1175
1175
1176
s[replace] = 'with';
1176
1177
@@ -1610,7 +1611,7 @@ Whereas these two are not:
1610
1611
my $rx3 = rx/a :i b/; # matches only the b case insensitively
1611
1612
my $rx4 = rx/:i a b/; # matches completely case insensitively
1612
1613
1613
- Brackets and parentheses limit the scope of an adverb:
1614
+ Square brackets and parentheses limit the scope of an adverb:
1614
1615
1615
1616
/ (:i a b) c /; # matches 'ABc' but not 'ABC'
1616
1617
/ [:i a b] c /; # matches 'ABc' but not 'ABC'
@@ -1958,10 +1959,10 @@ to the more readable
1958
1959
}
1959
1960
1960
1961
As a rule of thumb, use whitespace around atoms and inside groups; put
1961
- quantifiers directly after the atom; and vertically
1962
- align opening and closing brackets and parentheses.
1962
+ quantifiers directly after the atom; and vertically align opening and closing
1963
+ square brackets and parentheses.
1963
1964
1964
- When you use a list of alternations inside a parenthesis or brackets, align
1965
+ When you use a list of alternations inside parentheses or square brackets, align
1965
1966
the vertical bars:
1966
1967
1967
1968
my regex example {
@@ -2036,8 +2037,8 @@ restrictive. Somebody might write C<[two words]>, or use dashes, etc.
2036
2037
Instead of asking what's allowed on the inside, it might be worth asking
2037
2038
instead: I < what's not allowed? >
2038
2039
2039
- Clearly, closing brackets are not allowed, because C < [a]b] > would be
2040
- ambiguous. By the same argument, opening brackets should be forbidden.
2040
+ Clearly, closing square brackets are not allowed, because C < [a]b] > would be
2041
+ ambiguous. By the same argument, opening square brackets should be forbidden.
2041
2042
This leaves us with
2042
2043
2043
2044
token header { '[' <-[ \[\] ]>+ ']' }
0 commit comments