@array=('human.NT_113898','human.contig.1','human.2','human.IV'); foreach (@array) { if(/(\w+\.)(\w+|\d+|\.)/){print $2."\n";} }