My question sounds trivial, but I google many page still can't not find an answer.
I am on Windows. I have a text file. If I open it with Notepad++, it looks like this

I want to try several things
delete all carriage return and line feed
perl -i.bak -pe "s/\r\n//g" a.txt
surprisingly, there is nothing changed. What is wrong? But according to the doc, I am pretty sure \r is CR and \n is LF
- What I actually want to do is match across line. for example
^function.*\r\n!will match just like Notepad++ will does

If we want to indent the ! line if its previous line is started with "function", a naive thought would be (actually it works is notepad++)
perl -i.bak -pe "s/^(function.*\r\n)!/$1\t!/g" a.txt
But it didn't work. How to do it correctly?
perl -i.bak -pe "s/^(.*\r\n)!/$1\t!/sg" a.txtor elseperl -i.bak -pe "s/\s*$//sg" a.txtperl -i.bak -pe "s/\\R+//g" a.txt