my $string = "This needs to match!"; if ( $string =~ /mAtCh/i ) { print $string, " matched.\n"; } #### my $string = "Here is some TEXT."; { my $teststr = lc $string; if ( $teststr =~ m/text/ ) { print "$string matched.\n"; } }