Re: Is there a backward "for @"

2018-05-15 Thread ToddAndMargo
On 05/15/2018 05:32 PM, Brock Wilcox wrote: Slightly more idiomatic might be `next unless $line`. Interesting! Thank you!

Re: Is there a backward "for @"

2018-05-15 Thread Brock Wilcox
Slightly more idiomatic might be `next unless $line`. On Tue, May 15, 2018 at 7:39 PM ToddAndMargo wrote: > On 05/15/2018 04:34 PM, ToddAndMargo wrote: > > On 05/15/2018 03:49 PM, Larry Wall wrote: > >> On Tue, May 15, 2018 at 03:31:07PM -0700, ToddAndMargo wrote: > >> : Hi All, > >> : > >> : Th

Re: Is there a backward "for @"

2018-05-15 Thread ToddAndMargo
On 05/15/2018 04:34 PM, ToddAndMargo wrote: On 05/15/2018 03:49 PM, Larry Wall wrote: On Tue, May 15, 2018 at 03:31:07PM -0700, ToddAndMargo wrote: : Hi All, : : This seems like a trivial question, but I really adore : the "for" loops.  Is there a way to do the backwards? : In other words, start

Re: Is there a backward "for @"

2018-05-15 Thread ToddAndMargo
On 05/15/2018 03:49 PM, Larry Wall wrote: On Tue, May 15, 2018 at 03:31:07PM -0700, ToddAndMargo wrote: : Hi All, : : This seems like a trivial question, but I really adore : the "for" loops. Is there a way to do the backwards? : In other words, start at the end of the array and loop : to the be

Re: Is there a backward "for @"

2018-05-15 Thread Larry Wall
On Tue, May 15, 2018 at 03:31:07PM -0700, ToddAndMargo wrote: : Hi All, : : This seems like a trivial question, but I really adore : the "for" loops. Is there a way to do the backwards? : In other words, start at the end of the array and loop : to the beginning? Does the "next" and "last" work i

Re: Is there a backward "for @"

2018-05-15 Thread ToddAndMargo
On 05/15/2018 03:31 PM, ToddAndMargo wrote: do the backwards do theM backwards mumble, mumble

Is there a backward "for @"

2018-05-15 Thread ToddAndMargo
Hi All, This seems like a trivial question, but I really adore the "for" loops. Is there a way to do the backwards? In other words, start at the end of the array and loop to the beginning? Does the "next" and "last" work in this? Inquiring minds want to know! Many thanks, -T

Re: number of letters question

2018-05-15 Thread ToddAndMargo
On 05/15/2018 10:05 AM, Larry Wall wrote: On Tue, May 15, 2018 at 12:44:12AM -0700, ToddAndMargo wrote: : "abcrd-12.3.4" would be five letters, six numbers, and one : I don't care. Here's another approach: $ p6 '"abcrd-12.3.4".comb.classify(*.uniprop).say' {Ll => [a b c r d], Nd => [

Re: Need match character help

2018-05-15 Thread ToddAndMargo
On 05/15/2018 07:05 AM, Timo Paulssen wrote: On 15/05/18 13:49, ToddAndMargo wrote: Hi All, This should be a "no".  What am I doing wrong? $ perl6 -e 'my $x="rd"; if $x~~/<[rc]+[a]+[b]+[.]>/ {say "yes"}else{say "no"}' yes Many thanks, -T what you've put in your regex here is a character cl

Re: Need match character help

2018-05-15 Thread ToddAndMargo
On 05/15/2018 07:06 AM, Timo Paulssen wrote: On 15/05/18 14:03, ToddAndMargo wrote: On 05/15/2018 04:49 AM, ToddAndMargo wrote: Hi All, This should be a "no".  What am I doing wrong? $ perl6 -e 'my $x="rd"; if $x~~/<[rc]+[a]+[b]+[.]>/ {say "yes"}else{say "no"}' yes Many thanks, -T And how

Re: number of letters question

2018-05-15 Thread Andy Bach
> though from the problem question it sounds a lot more like what todd wants is my $input = "abcrd-12.3.4"; my $letters = $input.comb(/<[a..z]>/); my $numbers = $input.comb(/<[a..z 0..9 .]>/); say "the string $input has $letters letters and $numbers numbers and periods."; Just a no

Re: number of letters question

2018-05-15 Thread Larry Wall
On Tue, May 15, 2018 at 12:44:12AM -0700, ToddAndMargo wrote: : "abcrd-12.3.4" would be five letters, six numbers, and one : I don't care. Here's another approach: $ p6 '"abcrd-12.3.4".comb.classify(*.uniprop).say' {Ll => [a b c r d], Nd => [1 2 3 4], Pd => [-], Po => [. .]} $ p6 '"

Re: number of letters question

2018-05-15 Thread Timo Paulssen
I'd suggest combing for the regex instead of combing and then grepping with the regex: say + "abcrd-12.3.4".comb(//); though from the problem question it sounds a lot more like what todd wants is     my $input = "abcrd-12.3.4";     my $letters = $input.comb(/<[a..z]>/);     my $numbers = $input.

Re: Need match character help

2018-05-15 Thread Timo Paulssen
On 15/05/18 14:03, ToddAndMargo wrote: > On 05/15/2018 04:49 AM, ToddAndMargo wrote: >> Hi All, >> >> This should be a "no".  What am I doing wrong? >> >> $ perl6 -e 'my $x="rd"; if $x~~/<[rc]+[a]+[b]+[.]>/ {say >> "yes"}else{say "no"}' >> yes >> >> >> Many thanks, >> -T > > And how do I turn this

Re: Need match character help

2018-05-15 Thread Timo Paulssen
On 15/05/18 13:49, ToddAndMargo wrote: > Hi All, > > This should be a "no".  What am I doing wrong? > > $ perl6 -e 'my $x="rd"; if $x~~/<[rc]+[a]+[b]+[.]>/ {say > "yes"}else{say "no"}' > yes > > > Many thanks, > -T what you've put in your regex here is a character class combined of four individual

Re: number of letters question

2018-05-15 Thread JJ Merelo
El mar., 15 may. 2018 a las 13:48, ToddAndMargo () escribió: > On 05/15/2018 02:45 AM, Brent Laabs wrote: > > /<+alnum-[_]>/. > > What does the `+` do? > + includes a category, - eliminates one category. Check out the regexes page https://docs.perl6.org/language/regexes Cheers > > Is there a

Re: Need match character help

2018-05-15 Thread ToddAndMargo
On 05/15/2018 04:49 AM, ToddAndMargo wrote: Hi All, This should be a "no".  What am I doing wrong? $ perl6 -e 'my $x="rd"; if $x~~/<[rc]+[a]+[b]+[.]>/ {say "yes"}else{say "no"}' yes Many thanks, -T And how do I turn this into a yes. I am look for any instance of d through z $ perl6 -e '

Need match character help

2018-05-15 Thread ToddAndMargo
Hi All, This should be a "no". What am I doing wrong? $ perl6 -e 'my $x="rd"; if $x~~/<[rc]+[a]+[b]+[.]>/ {say "yes"}else{say "no"}' yes Many thanks, -T

Re: number of letters question

2018-05-15 Thread ToddAndMargo
On 05/15/2018 02:45 AM, Brent Laabs wrote: /<+alnum-[_]>/. What does the `+` do? Is there a was to write that to include decimal points (or any other weird character)?

Re: number of letters question

2018-05-15 Thread ToddAndMargo
On 05/15/2018 02:45 AM, Brent Laabs wrote: Just a quick reminder that matches the underscore, because also does.  If you want to exclude underscores, you can match against /<+alnum-[_]>/.  That adds the alnum character class, but subtracts underscores from it.   Decimal points are definitely

Re: number of letters question

2018-05-15 Thread Brent Laabs
Just a quick reminder that matches the underscore, because also does. If you want to exclude underscores, you can match against /<+alnum-[_]>/. That adds the alnum character class, but subtracts underscores from it. Decimal points are definitely not alphanumeric, though. On Tue, May 15, 2018

Re: number of letters question

2018-05-15 Thread JJ Merelo
El mar., 15 may. 2018 a las 10:17, ToddAndMargo () escribió: > On 05/15/2018 12:57 AM, JJ Merelo wrote: > > Well, > > say + "abcrd-12.3.4".comb.grep: // > > will give you that, but > > say + "abcñé-12.3.4".comb.grep: // > > will yield the same result. > > Roman or other kind of numerals are exclud

Re: number of letters question

2018-05-15 Thread ToddAndMargo
On 05/15/2018 12:57 AM, JJ Merelo wrote: Well, say + "abcrd-12.3.4".comb.grep: // will give you that, but say + "abcñé-12.3.4".comb.grep: // will yield the same result. Roman or other kind of numerals are excluded, though... $ perl6 -e 'say + "abcrd-12.3.4".comb.grep: //;' 9 I don't understan

Re: number of letters question

2018-05-15 Thread JJ Merelo
Well, say + "abcrd-12.3.4".comb.grep: // will give you that, but say + "abcñé-12.3.4".comb.grep: // will yield the same result. Roman or other kind of numerals are excluded, though... El mar., 15 may. 2018 a las 9:44, ToddAndMargo () escribió: > On 05/15/2018 12:37 AM, JJ Merelo wrote: > > Hi, >

Re: number of letters question

2018-05-15 Thread ToddAndMargo
On 05/15/2018 12:37 AM, JJ Merelo wrote: Hi, El mar., 15 may. 2018 a las 9:31, ToddAndMargo (>) escribió: >> El mar., 15 may. 2018 a las 8:32, ToddAndMargo (mailto:toddandma...@zoho.com> >>

Re: number of letters question

2018-05-15 Thread JJ Merelo
Hi, El mar., 15 may. 2018 a las 9:31, ToddAndMargo () escribió: > >> El mar., 15 may. 2018 a las 8:32, ToddAndMargo ( >> >) escribió: > >> > >> Hi All, > >> > >> Do we have one of those sweet functions that will > >> allow us to look at a string and give

Re: number of letters question

2018-05-15 Thread ToddAndMargo
El mar., 15 may. 2018 a las 8:32, ToddAndMargo (>) escribió: Hi All, Do we have one of those sweet functions that will allow us to look at a string and give us back the count of how many "letters" and/or "numbers" are in a string? And are de