#!/usr/bin/perl use strict; use warnings; my @tags = qw( 8= 9= 35= ); my $reg_ex = join( '|', @tags ); open(FH, "test.log")||die("Unable to open log file: $! \n"); while() { print "$_\n" if ( $_ =~ /$reg_ex/s ); } #### $ perl t.pl 2005/11/18 00:06:49:875: FIXPump: Received data on connection {OBMSCNX} [8=FIX.4.29=040435=849=EXLINK256=DB_ORDER50=DESRISKGATEWAY57=DCN3230134=4045052=20051118-05:06:491=ATOP116=0.0000000011=DES:fud630_2005111814=15.000017=0131730433520=031=138.0800000032=15.000037=131726062238=15.000039=254=155=ContractNum60=20051118-05:06:49150=2151=0.0000198=13173047101317260622109=DCN3230163=0167=FUT200=200512207=TSE40=244=138.080000005113=06556=20051117-23:06:4610=230]