Today when I reviewed our project's source code, I found there are lots of unnecessary "spaces" and "tabs" located at each line's end. So I decided to delete them with regular expression.
However, I found the command sed -i '/\s+$/d' doesn't work. Until I changed the command to see -ri '/\s+$/d', it acted as my expectation. From the manual of sed, it said -r invokes extended regexp.
I'm confused, why there are so many regexp variants? Like vim/emacs/perl/sed regexp. Why can't the regexp offer an unique user interface?
-ris not portable,-Eis. – Kamil Maciorowski Feb 21 '24 at 16:20