my $pattern = "(?i)SILICONEXsiliconex-wafers"; if ($cust_code =~ /$pattern/){ print "$&\n"; }