As the examples below show, absent the m modifier, '$' does not match an internal new line, but it is perfectly happy matching a final newline after an internal newline:
Therein may lie your problem. A newline is a character and $ is a zero-width assertion which will never match a character. :-)
In reply to Re^3: When exactly do Perl regex's require a full match on a string?
by jwkrahn
in thread When exactly do Perl regex's require a full match on a string?
by ELISHEVA
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |