Save as Text Doc "boo.txt" -> saved as boo.txt /\.txt\z/==1 Save as Text Doc "boo" -> saved as boo.txt /\.txt\z/==0 Save as Text Doc "boo." -> saved as boo..txt /\.txt\z/==0 Save as Text Doc "boo.pl" -> saved as boo.pl.txt /\.txt\z/==0 Save as Text Doc "boo. pl" -> saved as boo. pl.txt /\.txt\z/==0 Save as All Files "boo.txt" -> saved as boo.txt '.txt' ne '' Save as All Files "boo" -> saved as boo.txt '' eq '' Save as All Files "boo." -> saved as boo. '.' ne '' Save as All Files "boo.pl" -> saved as boo.pl '.pl' ne '' Save as All Files "boo. pl" -> saved as boo. pl.txt '' eq ''