Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

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

Comment on Re: making regex case insensitive
Download Code

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 making s'mores by the fire in the courtyard of the Monastery: (4)
As of 2015-10-10 15:10 GMT
Find Nodes?
    Voting Booth?

    Does Humor Belong in Programming?

    Results (257 votes), past polls