in reply to what regular expression do I need?

Try this..

while(<FILE>) { if($_ =~ /I/ || $_ =~ /M/ || $_ =~ /O/){} else { print "\n $_"; } }