in reply to Cleaning up a text file with compact regex

As you asked for a regex... $line =~ /^(>.*|[ATCG]*)$/ the whole line should be captured into $1