The $ anchor will match the end of the line with or without a newline at the end so /^;$/ will match both ";" and ";\n".
In reply to Re^2: How to match a ;
by jwkrahn
in thread How to match a ;
by ewhitt
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |