develooper Front page | perl.perl6.users | Postings from November 2017

tip: case insensitive test

Thread Next
November 3, 2017 22:31
tip: case insensitive test
Message ID:
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";}'



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

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About