Skip to content

Commit 000ff68

Browse files
committed
Clarify where rx declarator allows adverbs
A regex declared with `rx` allows adverbs both before the delimiter (`rx:s/pattern/`) and after (`rx/:s pattern/`), but the docs only mentioned the first option. This fixes that, and brings the rx section of the page into alignment with the adverb section.
1 parent e223f5e commit 000ff68

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

doc/Language/regexes.pod6

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,12 +84,14 @@ of a L<comment|/language/syntax#Single-line_comments> that runs until the end of
8484
the line.
8585
=end item
8686
87-
Secondly, the C<rx> form enables the use of
88-
L<regex adverbs|/language/regexes#Regex_adverbs>, which may be placed between C<rx> and the
89-
opening delimiter to modify the definition of the entire regex:
87+
Secondly, the C<rx> form allows you to insert
88+
L<regex adverbs|/language/regexes#Regex_adverbs> between C<rx> and the
89+
opening delimiter to modify the definition of the entire regex. This is equivalent to
90+
inserting the adverb at the beginning of the regex, but may be clearer:
9091
9192
rx:r:s/pattern/; # :r (:ratchet) and :s (:sigspace) adverbs, defining
9293
# a ratcheting regex in which whitespace is significant
94+
rx/:r:s pattern/; # Same, but possibly less readable
9395
9496
Although anonymous regexes are not, as such, I<named>, they may effectively be
9597
given a name by putting them inside a named variable, after which they can be

0 commit comments

Comments
 (0)