Ok, got it, thanks. This is some wacky, yet documented edge case. > ... By default, '^' matches only at the beginning of the string, and '$' only at the end of the string and immediately before the newline (if any) at the end of the string.