#!/usr/bin/perl $file = 'Muguga.embl '; open (F, $file) || die ("Could not open $file!"); while ($line = ) { ($field1,$field2,$field3,$field4) = split( "\t" , $line); print "$field1 $field2 $field3 $field4 \n"; my $string = (FT CDS complement(join(18028..18116,19351..20668))); # string to be searched if ($string = ~ m/^FT \s+ CDS \s+ complement\(join\([0-9]+\)\)$/) #search for the first line highlighted in bold { print 'match' } else{ print 'no match'; } } close (F);