Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

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 # - 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"; }

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (4)
As of 2016-10-22 22:47 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (299 votes). Check out past polls.