in reply to Re^5: Strange regex to test for newlines: /.*\z/
in thread Strange regex to test for newlines: /.*\z/

"\n" =~ /\n.*\z/; # matches
Obvious, I think.

If this one is obvious, then the original one should be obvious too. Compare:

"\n" =~ /\n.*\z/; # matches "\n" =~ /.*\z/; # should match but doesn't

The pattern gets shorter, but doesn't match any more...