if ( $line =~ /name/i and $line !~ /:/ ) { ... }