"\n" =~ /\n.*\z/; # matches "\n" =~ /.*\z/; # doesn't match. i would expect it to match "\n" =~ /[^\n]*\z/; # matches. like expected. but [\n]* is like .*