in reply to Re: Regex perl grep usage string match comparison
in thread Regex perl grep usage string match comparison

Implemented the code and it works but have some more things to be added
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"; }
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??

Replies are listed 'Best First'.
Re^3: Regex perl grep usage string match comparison
by Athanasius (Archbishop) on Oct 12, 2014 at 04:15 UTC