in reply to what regular expression do I need?

Assuming you know how to read a file line by line:

 print "$. : $line\n" if $line =~ m/[^IMO]/;

Cheers Rolf

( addicted to the Perl Programming Language)