I need help with ~~m/

2021-01-29 Thread ToddAndMargo via perl6-users
Hi All, rakudo-pkg-2020.12-01.x86_64 Why does this work? > $x = "1.33.222.4"; 1.33.222.4 > $x ~~ m/ (<:N>+) [.] (<:N>+) [.] (<:N>+) [.] (<:N>+) /; 「1.33.222.4」 0 => 「1」 1 => 「33」 2 => 「222」 3 => 「4」 But this does not? --> Why the wrong number in $2? --> Why no Nil for $3? > $x = "

Re: I need help with ~~m/

2021-01-29 Thread JJ Merelo
El sáb, 30 ene 2021 a las 7:24, ToddAndMargo via perl6-users (< perl6-us...@perl.org>) escribió: > Hi All, > > rakudo-pkg-2020.12-01.x86_64 > > Why does this work? > > > $x = "1.33.222.4"; > 1.33.222.4 > > $x ~~ m/ (<:N>+) [.] (<:N>+) [.] (<:N>+) [.] (<:N>+) /; > 「1.33.222.4」 > 0 => 「1」 > 1