Re: case insensitive "contains"?

2018-09-11 Thread ToddAndMargo
On 09/11/2018 03:53 PM, Trey Harris wrote: And my response to his response that also was unintentionally off-list. I got it. I will probably be writing it down later today in my documents. My failing was thinking rx was some kind of command I had not seen before. As soon as you showed me

Re: case insensitive "contains"?

2018-09-11 Thread Trey Harris
And my response to his response that also was unintentionally off-list. (Todd, if you don't mind resending your last private response—since your other response was quoted below—in reply to this, please do.) On Mon, Sep 10, 2018 at 22:00 ToddAndMargo wrote: > So you get to iteratively pick what

Re: case insensitive "contains"?

2018-09-11 Thread Trey Harris
Oops— I sent the following yesterday and it somehow didn't go to the list: On Mon, Sep 10, 2018 at 19:02 ToddAndMargo wrote: > Question, what the heck is > > my $rx1 = rx:i/a/; > > Are they talking over beginner's heads again? > In the sense of "beginners to Perl", perhaps, since "rx" is

Re: case insensitive "contains"?

2018-09-10 Thread ToddAndMargo
On 09/10/2018 08:15 AM, Ralph Mellor wrote: Hi Todd, What are the rules for what goes inside and what goes outside? Also, do y have a link to what the various ":x" commands are that I can use? See https://docs.perl6.org/language/regexes#Adverbs The first section explains the two

Re: case insensitive "contains"?

2018-09-10 Thread ToddAndMargo
On 09/10/2018 08:36 AM, Laurent Rosenfeld via perl6-users wrote: Yes, copy and paste error on the last code snippet. say "Yes" if "2018 xJul 7" ~~ m/j :i ul/; Cheers, Laurent. Now that is down right cleaver! I can change my mind as I go. Thank you!

Re: case insensitive "contains"?

2018-09-10 Thread ToddAndMargo
Hi Laurent, Thank you! Another weapon in my tool box! Question: this confused me when I first look at it. I am use to the ":x" command being outside the first "/". For instance s:g/ What are the rules for what goes inside and what goes outside? Also, do y

Re: case insensitive "contains"?

2018-09-10 Thread Laurent Rosenfeld via perl6-users
Yes, copy and paste error on the last code snippet. say "Yes" if "2018 xJul 7" ~~ m/j :i ul/; Cheers, Laurent. Le lun. 10 sept. 2018 à 16:54, yary a écrit : > > say "Yes" if "2018 xJul 7" ~~ m:i/j :i ul/; > you mean > > say "Yes" if "2018 xJul 7" ~~ m/j :i ul/; > > m/.../ - not m:i at the

Re: case insensitive "contains"?

2018-09-10 Thread Ralph Mellor
Hi Todd, > What are the rules for what goes inside and what goes outside? > Also, do y have a link to what the various ":x" commands are that I can use? > See https://docs.perl6.org/language/regexes#Adverbs The first section explains the two types of "adverb". "regex adverbs" like `:i` can go

Re: case insensitive "contains"?

2018-09-10 Thread yary
> say "Yes" if "2018 xJul 7" ~~ m:i/j :i ul/; you mean say "Yes" if "2018 xJul 7" ~~ m/j :i ul/; m/.../ - not m:i at the start! -y On Mon, Sep 10, 2018 at 4:54 AM, Laurent Rosenfeld via perl6-users < perl6-us...@perl.org> wrote: > Hi Todd, > > you may use: > > say "Yes" if "2018 xJul 7" ~~

Re: case insensitive "contains"?

2018-09-10 Thread Laurent Rosenfeld via perl6-users
Hi Todd, you may use: say "Yes" if "2018 xJul 7" ~~ /:i jul/; or: say "Yes" if "2018 xJul 7" ~~ m:i/jul/; In the second case, the adverb will apply to the whole pattern. In the first case, it will start to apply from the point where the adverb is. In this specific example, those two code

Re: case insensitive "contains"?

2018-09-09 Thread ToddAndMargo
On 09/08/2018 12:23 PM, Laurent Rosenfeld via perl6-users wrote: Using the fc method is certainly a good way to do case insensitive string comparisons, but you may at this point also use a regex with the :i (ignore case) adverb. > if "2018 xJul 7" ~~ /:i jul/ {say "Yes";} Yes Hi Laurent,

Re: case insensitive "contains"?

2018-09-08 Thread Laurent Rosenfeld via perl6-users
Using the fc method is certainly a good way to do case insensitive string comparisons, but you may at this point also use a regex with the :i (ignore case) adverb. > if "2018 xJul 7" ~~ /:i jul/ {say "Yes";} Yes Le sam. 8 sept. 2018 à 00:56, ToddAndMargo a écrit : > On 09/07/2018 03:49 PM,

Re: case insensitive "contains"?

2018-09-07 Thread ToddAndMargo
On 09/07/2018 03:49 PM, ToddAndMargo wrote: Hi All, How do I use "contains" without regard to case? $ p6 'if "2018 Jul 7".contains( "jul", 3 ) {say "Yes";}' Many thanks, -T The chat line helped me figure it out: $ p6 'if "2018 Jul 7".fc.contains( "jul".fc ) {say "Yes";}' Yes $ p6 'if

case insensitive "contains"?

2018-09-07 Thread ToddAndMargo
Hi All, How do I use "contains" without regard to case? $ p6 'if "2018 Jul 7".contains( "jul", 3 ) {say "Yes";}' Many thanks, -T