http://www.perlmonks.org?node_id=616565


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

One problem tho, the following all match the string "\n":
/.*/ /\z/ /.{0}\z/
It's possible that \z is meant to introduce some specialness when combined with .* (or possibly some other quantifiers), but I haven't seen it mentioned in any docs. This is either a bug, or a very poorly documented feature.