Re: tip: case insensitive test

2017-11-07 Thread ToddAndMargo

On 11/07/2017 03:12 PM, ToddAndMargo wrote:
On Fri, Nov 3, 2017 at 5:30 PM, ToddAndMargo  
wrote:

Dear List,

Okay, I am pretty sure there are no copyrights here.

I had a problem where I had to read through a YUGE log file and
pick out those entries with a particular name in it.  Problem"
it was the same name but three different capitalizations and
the the capitalization was a moving target.  I couldn't count
on it staying the same.

and `i/test/` or `:i/test/` did not work.

One of the guys helped me out with this on the chat line.
`m:i/test/` did the trick, and forgave me for not actually
doing a match.  He said one of the benefits of "m" was that
it allows for more things like "i" to be included

Here is a test one liner:

$ perl6 -e 'my $x="abcDEF"; if ( $x ~~ m:i/abcdef/ ) { say "yes";} 
else {

say "no";}'

yes



On 11/07/2017 10:01 AM, Brad Gilbert wrote:
 > The way to add `:i` to regex without using `m` is to include it inside
 > of the regex `/:i abcdef/`
 >

Thank you!

$ perl6 -e 'my $x="abcDEF"; if ( $x ~~ /:i abcdef/ ) { say "yes";} else 
{say "no";}'


yes


I figure out why I could not get that to work.  I kept
typo'ing "1" for "i".  Maybe it was leftover habit from
high school typing class where a "1" and and "i" were the
same thing.

:'(


What, that was "1" and "l".  I am losing it.



--
~
When we ask for advice, we are usually looking for an accomplice.
   --  Charles Varlet de La Grange
~


Re: tip: case insensitive test

2017-11-07 Thread ToddAndMargo

On Fri, Nov 3, 2017 at 5:30 PM, ToddAndMargo  wrote:

Dear List,

Okay, I am pretty sure there are no copyrights here.

I had a problem where I had to read through a YUGE log file and
pick out those entries with a particular name in it.  Problem"
it was the same name but three different capitalizations and
the the capitalization was a moving target.  I couldn't count
on it staying the same.

and `i/test/` or `:i/test/` did not work.

One of the guys helped me out with this on the chat line.
`m:i/test/` did the trick, and forgave me for not actually
doing a match.  He said one of the benefits of "m" was that
it allows for more things like "i" to be included

Here is a test one liner:

$ perl6 -e 'my $x="abcDEF"; if ( $x ~~ m:i/abcdef/ ) { say "yes";} else {
say "no";}'

yes



On 11/07/2017 10:01 AM, Brad Gilbert wrote:
> The way to add `:i` to regex without using `m` is to include it inside
> of the regex `/:i abcdef/`
>

Thank you!

$ perl6 -e 'my $x="abcDEF"; if ( $x ~~ /:i abcdef/ ) { say "yes";} else 
{say "no";}'


yes


I figure out why I could not get that to work.  I kept
typo'ing "1" for "i".  Maybe it was leftover habit from
high school typing class where a "1" and and "i" were the
same thing.

:'(


Re: tip: case insensitive test

2017-11-07 Thread Brad Gilbert
The way to add `:i` to regex without using `m` is to include it inside
of the regex `/:i abcdef/`

On Fri, Nov 3, 2017 at 5:30 PM, ToddAndMargo  wrote:
> Dear List,
>
> Okay, I am pretty sure there are no copyrights here.
>
> I had a problem where I had to read through a YUGE log file and
> pick out those entries with a particular name in it.  Problem"
> it was the same name but three different capitalizations and
> the the capitalization was a moving target.  I couldn't count
> on it staying the same.
>
> and `i/test/` or `:i/test/` did not work.
>
> One of the guys helped me out with this on the chat line.
> `m:i/test/` did the trick, and forgave me for not actually
> doing a match.  He said one of the benefits of "m" was that
> it allows for more things like "i" to be included
>
> Here is a test one liner:
>
> $ perl6 -e 'my $x="abcDEF"; if ( $x ~~ m:i/abcdef/ ) { say "yes";} else {
> say "no";}'
>
> yes
>
>
> -T
>
> --
> ~~~
> Having been erased,
> The document you're seeking
> Must now be retyped.
> ~~~


tip: case insensitive test

2017-11-03 Thread ToddAndMargo

Dear List,

Okay, I am pretty sure there are no copyrights here.

I had a problem where I had to read through a YUGE log file and
pick out those entries with a particular name in it.  Problem"
it was the same name but three different capitalizations and
the the capitalization was a moving target.  I couldn't count
on it staying the same.

and `i/test/` or `:i/test/` did not work.

One of the guys helped me out with this on the chat line.
`m:i/test/` did the trick, and forgave me for not actually
doing a match.  He said one of the benefits of "m" was that
it allows for more things like "i" to be included

Here is a test one liner:

$ perl6 -e 'my $x="abcDEF"; if ( $x ~~ m:i/abcdef/ ) { say "yes";} else 
{ say "no";}'


yes


-T

--
~~~
Having been erased,
The document you're seeking
Must now be retyped.
~~~