in reply to Re^2: How to match a ;
in thread How to match a ;

The  $ regex metacharacter will "[m]atch the end of the line (or before newline at the end)" (emphasis added, perlre section Regular Expressions).

In the presence of the /m regex modifier, the behavior of  $ is enhanced.