There's not much use in doing a global regex match with an anchored regex.
Furthermore, a global regex match returns a list of matches, so use a for-loop to iterate over them:
use v6; my $line = '124des123'; for $line ~~ m:g/ \d ** 2..3 / -> $match { say ~$match; }
Output:
124 123
In reply to Re: Perl6 global regex matching
by moritz
in thread Perl6 global regex matching
by Sathishkumar
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |