Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: making regex case insensitive

by marinersk (Curate)
on Jul 16, 2013 at 15:41 UTC ( #1044628=note: print w/ replies, xml ) Need Help??


in reply to making regex case insensitive

Both preceding answers are excellent; one tells you how to find the answer, the other shows it to you.

I would add that if you are manually processing each element of the array, you may be doing it the hard way:

#!/usr/bin/perl # testgreparray.pl - Check behavior of grep on arrays use strict; my @cmdrsp = ( 'This is a test.', 'A booger a day keeps the doctor at bay.', 'Blimey, laddy, it\'s a booger!' ); if (grep(/booger/, @cmdrsp)) { print "Found it the easy way\n"; } my @searsp = grep(/booger/, @cmdrsp); my $seacnt = @searsp; if ($seacnt) { print "Found it the hard way\n"; }


Comment on Re: making regex case insensitive
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1044628]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (12)
As of 2015-07-31 19:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (280 votes), past polls