How to match string end for a multiline string?

Hi, $ matches line end. When a string has multiple lines, how to much the last line end? Thanks, Peng