Happened again today, and it took me ages before I realized why.
^ assert start of string (or line, in multiline mode)
$ assert end of string (or line, in multiline mode)
The issue is this:
When the EOLs are Unix/Amiga style, the ^ doesn't work. It works fine when the EOLs are DOS/Windows.
Not tried it for Mac style EOLs.