Skip to content

Commit 6dec94a

Browse files
authored
m/ / and / / examples added
Added examples to help illustrate difference between m/ / and / /. Zoffix provided the examples. I provided the learning. An example for rx/ / is needed. As a newbie, this info is very helpful and rare. It is not in Think Perl 6, ttbomk. And definitely not in Perl6Intro.com. Needed info or something better.
1 parent 90221c6 commit 6dec94a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

doc/Language/regexes.pod6

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ is forbidden because it clashes with adverbs, such as C<rx:i/abc/>
2828
(case insensitive regexes), and round parentheses indicate a function call
2929
instead.
3030
31+
Example of difference between 'm/ /' and '/ /' operators:
32+
33+
$_ = "abc"; my $match = m/.+/; say $match; # Output: 「abc」
34+
$_ = "abc"; my $match = /.+/; say $match; # Output: /.+/
35+
3136
Whitespace in regexes is generally ignored (except with the C<:s> or,
3237
completely, C<:sigspace> adverb).
3338

0 commit comments

Comments
 (0)