On Mon, 11 Dec 2023, at 07:31, ToddAndMargo via perl6-users wrote: > [0] > my Str $x="abc3defg"; if $x.match( / ^ <[0..9]> ** 8 $ / ) { print > "True\n"; } else { print "False\n" }; > False > > "3" is in the string. Why False? Because you asked for a match with a string consisting entirely of exactly 8 digits. > my Str $x="abc3defg"; if $x.match( / ^ <[a..h]> ** 8 $ / ) { print > "True\n"; } else { print "False\n" }; > False > > a and b and c and d and e and f and g are also in the string. > Why the false? Because the string doesn't exist of exactly eight letters in the range a..h. I.e. there's a 3 in there which isn't a letter in the range a..h.
- Test not working so well ToddAndMargo via perl6-users
- Re: Test not working so well Tom Browder
- Re: Test not working so well ToddAndMargo via perl6-users
- Re: Test not working so well William Michels via perl6-users
- Re: Test not working so w... ToddAndMargo via perl6-users
- Re: Test not working... ToddAndMargo via perl6-users
- Re: Test not wor... William Michels via perl6-users
- Re: Test not... ToddAndMargo via perl6-users
- Re: Test not... ToddAndMargo via perl6-users
- Re: Test not... ToddAndMargo via perl6-users
- Re: Test not... Kevin Pye
- Re: Test not... ToddAndMargo via perl6-users
- Re: Test not... Kevin Pye
- Re: Test not... ToddAndMargo via perl6-users
- Re: Test not... William Michels via perl6-users
- Re: Test not... ToddAndMargo via perl6-users
- Re: Test not... Kevin Pye
- Re: Test not... ToddAndMargo via perl6-users
- Re: Test not... ToddAndMargo via perl6-users
- Re: Test not... William Michels via perl6-users
- Re: Test not... ToddAndMargo via perl6-users