if($inputline6 =~ $configitem) { In this line which comparison operator shud be put so that if the string I am searching for is "exception" but the line in the file might contain "MessageException" or "Message.Exception" .So primarily to ignore CASE or it could be part of word. Any help on this??foreach $inputline (@input_array) { my @inputline = split(/\|/, $inputline); $inputline[8] = "Other Application event"; my $lastColumn = "#>"; push @inputline, $lastColumn; #Check ETYPE and change EOUTCOME if ($inputline[2] eq 'INFO') { $inputline[5] = "INFO"; } elsif ($inputline[2] eq 'ERROR') { $inputline[5] = "ERROR"; } #Check EMSG and create new field next to it foreach $configline (@cfg_array) { my @configline_array = split(/\|/, $configline); shift @configline_array; for $configitem (@configline_array) { if($inputline[6] =~ $configitem) { my $lastColumn = pop @inputline; $inputline[8] = $configline_array[0]; push @inputline, $lastColumn; last; } } } $line = join('|', @inputline); print $output_fh $line, "\n"; }
In reply to Re^2: Regex perl grep usage string match comparison
by justinkala
in thread Regex perl grep usage string match comparison
by justinkala
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |