..\n is a valid, albeit very bizarre, file name. This regex
would incorrectly filter them out. I believe a more correct
solution is to say
/\.\.?\z/
\z is a zero width assertion that is true when you are at the
actual end of the line as opposed to $, which anchors to the
end of the line or possibly \n and the end of the line.