in reply to RE: RE: Remove '.' and '..' from a list of filenames
in thread Remove '.' and '..' from a list of filenames

..\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.

mikfire

Replies are listed 'Best First'.
A reply falls below the community's threshold of quality. You may see it by logging in.