my $line = "abd"; if ($line =~ /abcd/i) { print "matched the first case\n"; } if ($line =~ /[abcd]/i) { print "matched the second case\n"; }