`perl -0pe` wants `.\n^`, not `.$\n^`
I am confused.
cat << EOF > test.txt
this
is
a
text
file
EOF
cat test.txt | perl -0pe 's/.\n^text/hellohello/smg'
works, but
cat test.txt | perl -0pe 's/.$\n^text/hellohello/smg'
doesn't.
Annoyingly https://regex101.com/ doesn't detect this quirk. Is it to do with -0? And why would $\n^ syntax (which is usually perfectly fine) be wrong anyway?