Cursus Raku / Expressiones regulares et grammaticae / Expressiones regulares / Substitutio et permutatio / Operator substitutionis

Quiz — Operator s///

Quid haec programma imprimit?

my $s = 'one two two';
$s ~~ s/two/three/;
say $s;
1one three two
0one three three
0one two two
0three two two

Sine adverbio :g s/// solam primam congruentiam permutat. Itaque solum primum two three fit, dans one three two. Cum s:g/// utraque occurrentia mutaretur.

Operator substitutionis   |   Capturae in permutatione