The answer to this question is \Z took me awhile to figure it out, but it works now. Note that conversely, \A matches beginning of the whole string (as opposed to ^ and $ matching the beginning of one line).
Python:
\Z Match absolute string end
Java, C# (.NET), PHP, Perl:
\Z Match string end (before last newline if present)
\z Match absolute string end
Go:
\z Match absolute string end
All of the above:
\A Match absolute string end