Re: Test not working so well

2023-12-11 Thread ToddAndMargo via perl6-users
This is from my keeper on "match". It is the Perl 5 way of explaining things. It works really well for me. How did I do? To find a match of "any" of the following my $x="abc2def"; say so $x.match( / ^ <+[0..9] + [a..z]> ** 7 $ / ) my $x="abc2def"; say so $x.match( / ^ <+[0..9] + [a..z]> **

Re: Test not working so well

2023-12-11 Thread ToddAndMargo via perl6-users
On 12/11/23 16:11, William Michels via perl6-users wrote: On Dec 11, 2023, at 15:54, ToddAndMargo via perl6-users wrote: On 12/11/23 15:48, William Michels via perl6-users wrote: On Dec 10, 2023, at 23:22, ToddAndMargo via perl6-users wrote: Is there a list somewhere of all the shortc

Re: Test not working so well

2023-12-11 Thread William Michels via perl6-users
> On Dec 11, 2023, at 15:54, ToddAndMargo via perl6-users > wrote: > > On 12/11/23 15:48, William Michels via perl6-users wrote: >>> On Dec 10, 2023, at 23:22, ToddAndMargo via perl6-users >>> wrote: >>> > > Is there a list somewhere of all the shortcuts, such as "alnum"? > -- https://do

Re: Test not working so well

2023-12-11 Thread ToddAndMargo via perl6-users
On 12/11/23 15:48, William Michels via perl6-users wrote: On Dec 10, 2023, at 23:22, ToddAndMargo via perl6-users wrote: On 12/10/23 22:26, William Michels via perl6-users wrote: Hi Bill, Yes it does help.  I am slowly getting there. If I do not know the length of the sting and have to as

Re: Test not working so well

2023-12-11 Thread ToddAndMargo via perl6-users
On 12/11/23 15:48, William Michels via perl6-users wrote: On Dec 10, 2023, at 23:22, ToddAndMargo via perl6-users wrote: On 12/10/23 22:26, William Michels via perl6-users wrote: Hi Bill, Yes it does help.  I am slowly getting there. If I do not know the length of the sting and have to as

Re: Test not working so well

2023-12-11 Thread William Michels via perl6-users
> On Dec 10, 2023, at 23:22, ToddAndMargo via perl6-users > wrote: > > On 12/10/23 22:26, William Michels via perl6-users wrote: > > Hi Bill, > Yes it does help. I am slowly getting there. > > If I do not know the length of the sting and have to ask > with .chars, is there a way to use a va

Re: Test not working so well

2023-12-11 Thread ToddAndMargo via perl6-users
On 12/11/23 13:39, ToddAndMargo via perl6-users wrote: On 12/11/23 00:55, Kevin Pye wrote: Seriously Todd? "What is a digit?" The characters '0' to '9' are digits.   (Unicode probably has a whole lot of others, but those will do for the moment.) Yes seriously.  Does '9' have the ascii value of

Re: Test not working so well

2023-12-11 Thread ToddAndMargo via perl6-users
On 12/11/23 00:55, Kevin Pye wrote: Seriously Todd? "What is a digit?" The characters '0' to '9' are digits. (Unicode probably has a whole lot of others, but those will do for the moment.) Yes seriously. Does '9' have the ascii value of 57 or the binary value of 9? Or do you mean a single c

Re: Test not working so well

2023-12-11 Thread Kevin Pye
Seriously Todd? "What is a digit?" The characters '0' to '9' are digits. (Unicode probably has a whole lot of others, but those will do for the moment.) On Mon, 11 Dec 2023, at 18:22, ToddAndMargo via perl6-users wrote: > On 12/10/23 22:26, William Michels via perl6-users wrote: > If I do not kn

Re: Test not working so well

2023-12-10 Thread ToddAndMargo via perl6-users
On 12/10/23 22:26, William Michels via perl6-users wrote: Inline: On Dec 10, 2023, at 12:25, ToddAndMargo via perl6-users wrote: On 12/9/23 22:49, William Michels via perl6-users wrote: f $x.match( / ^ <+[0..9] + [a..z]> ** 7 $ / ) { do something...}; What is the difference between    <

Re: Test not working so well

2023-12-10 Thread William Michels via perl6-users
Inline: > On Dec 10, 2023, at 12:25, ToddAndMargo via perl6-users > wrote: > > On 12/9/23 22:49, William Michels via perl6-users wrote: >> f $x.match( / ^ <+[0..9] + [a..z]> ** 7 $ / ) { do something...}; > > > What is the difference between > ><+[0..9] > and > <[0..9] > Nothing, atm

Re: Test not working so well

2023-12-10 Thread ToddAndMargo via perl6-users
On 12/10/23 19:52, Kevin Pye wrote: On Mon, 11 Dec 2023, at 09:24, ToddAndMargo via perl6-users wrote: On 12/10/23 14:16, Kevin Pye wrote: Because you asked for a match with a string consisting entirely of exactly 8 digits. I am not following. :'( ^beginning of string <[0..9]> a

Re: Test not working so well

2023-12-10 Thread Kevin Pye
On Mon, 11 Dec 2023, at 09:24, ToddAndMargo via perl6-users wrote: > On 12/10/23 14:16, Kevin Pye wrote: >> Because you asked for a match with a string consisting entirely of exactly 8 >> digits. > I am not following. :'( ^beginning of string <[0..9]> a digit ** 8 repeated exactly eig

Re: Test not working so well

2023-12-10 Thread ToddAndMargo via perl6-users
On 12/10/23 14:16, Kevin Pye wrote: 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

Re: Test not working so well

2023-12-10 Thread Kevin Pye
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 o

Re: Test not working so well

2023-12-10 Thread ToddAndMargo via perl6-users
On 12/10/23 12:25, ToddAndMargo via perl6-users wrote: On 12/9/23 22:49, William Michels via perl6-users wrote: f $x.match( / ^ <+[0..9] + [a..z]> ** 7 $ / ) { do something...}; What is the difference between     <+[0..9] and    <[0..9] And     / ^ <+[0..9] + [a..z]> ** 7 $ / does this

Re: Test not working so well

2023-12-10 Thread ToddAndMargo via perl6-users
On 12/9/23 22:49, William Michels via perl6-users wrote: f $x.match( / ^ <+[0..9] + [a..z]> ** 7 $ / ) { do something...}; What is the difference between <+[0..9] and <[0..9] And / ^ <+[0..9] + [a..z]> ** 7 $ / does this mean that both [0..9] AND [a..z] have to be present. In o

Re: Test not working so well

2023-12-09 Thread ToddAndMargo via perl6-users
On 12/9/23 22:49, William Michels via perl6-users wrote: On Dec 9, 2023, at 22:12, ToddAndMargo via perl6-users wrote: On 12/9/23 21:32, ToddAndMargo via perl6-users wrote: On 12/9/23 19:42, William Michels via perl6-users wrote: On 12/9/23 17:44, Tom Browder wrote: > Try: say so $=

Re: Test not working so well

2023-12-09 Thread William Michels via perl6-users
> On Dec 9, 2023, at 22:12, ToddAndMargo via perl6-users > wrote: > > On 12/9/23 21:32, ToddAndMargo via perl6-users wrote: >> On 12/9/23 19:42, William Michels via perl6-users wrote: >>> On 12/9/23 17:44, Tom Browder wrote: > Try: say so $= > Would you give me a

Re: Test not working so well

2023-12-09 Thread ToddAndMargo via perl6-users
On 12/9/23 21:32, ToddAndMargo via perl6-users wrote: On 12/9/23 19:42, William Michels via perl6-users wrote: On 12/9/23 17:44, Tom Browder wrote: > Try: say so $= > Would you give me a quick example? Hi Todd! In the Raku REPL (MoarVM 2023.05): [0] > my $x="abc2def"; say  $x ~~ / ^

Re: Test not working so well

2023-12-09 Thread ToddAndMargo via perl6-users
On 12/9/23 19:42, William Michels via perl6-users wrote: On 12/9/23 17:44, Tom Browder wrote: > Try: say so $= > Would you give me a quick example? Hi Todd! In the Raku REPL (MoarVM 2023.05): [0] > my $x="abc2def"; say  $x ~~ / ^ ** 7 $ /; 「abc2def」  alnum => 「a」  alnum => 「b」  aln

Re: Test not working so well

2023-12-09 Thread William Michels via perl6-users
> On 12/9/23 17:44, Tom Browder wrote: > > Try: say so $= > > > > Would you give me a quick example? Hi Todd! In the Raku REPL (MoarVM 2023.05): [0] > my $x="abc2def"; say $x ~~ / ^ ** 7 $ /; 「abc2def」 alnum => 「a」 alnum => 「b」 alnum => 「c」 alnum => 「2」 alnum => 「d」 alnum => 「e」 a

Re: Test not working so well

2023-12-09 Thread ToddAndMargo via perl6-users
On Sat, Dec 9, 2023 at 18:22 ToddAndMargo via perl6-users mailto:perl6-us...@perl.org>> wrote: Hi All, What am I doing wrong here? my $x="abc2def"; say  $x=/ ^ <[0..9]> ** 7 $ /; / ^ <[0..9]> ** 7 $ / [0] > my $x="abc2def"; say  $x=/ ^ <[l..z]> ** 7 $ /; / ^ <[l..z

Re: Test not working so well

2023-12-09 Thread Tom Browder
Try: say so $= On Sat, Dec 9, 2023 at 18:22 ToddAndMargo via perl6-users < perl6-us...@perl.org> wrote: > Hi All, > > What am I doing wrong here? > > > my $x="abc2def"; say $x=/ ^ <[0..9]> ** 7 $ /; > / ^ <[0..9]> ** 7 $ / > > [0] > my $x="abc2def"; say $x=/ ^ <[l..z]> ** 7 $ /; > / ^ <[l..

Test not working so well

2023-12-09 Thread ToddAndMargo via perl6-users
Hi All, What am I doing wrong here? my $x="abc2def"; say $x=/ ^ <[0..9]> ** 7 $ /; / ^ <[0..9]> ** 7 $ / [0] > my $x="abc2def"; say $x=/ ^ <[l..z]> ** 7 $ /; / ^ <[l..z]> ** 7 $ / [0] > my $x="abc2def"; say $x~~/ ^ <[0..9]> ** 7 $ /; Nil [0] > my $x="abc2def"; say $x~~/ ^ <[l..z]>