Happened again today, and it took me ages before I realized why.
The issue is this:^ assert start of string (or line, in multiline mode)
$ assert end of string (or line, in multiline mode)
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.